By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,299 Members | 1,242 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,299 IT Pros & Developers. It's quick & easy.

Multiple entries script...help

P: n/a
Ok,
In one table, I need to find all instances of multiple entries of an
invoice number in the column InvoiceNumber.

For example, there may be more than one entrie of 321, 567, and 987
in column InvoiceNumber.

321 skin care product
321 vitamins
321 bottled water

567 rubbing alcohol
567 dental floss

987 fabric softener
987 tissue paper
987 marlboro cigaretts

Any help is appreciated.
Thanks,
Trint

Sep 28 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
select InvoiceNumber, count(*) as 'Occurrences'
from dbo.MyTable
group by InvoiceNumber
having count(*) > 1

Simon

Sep 28 '05 #2

P: n/a
Simon,
Thanks!
Trint

..Net programmer
tr***********@gmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Sep 28 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.