Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Simple querry question: select * from table where

Author  Topic 

suarezst1984
Starting Member

16 Posts

Posted - 2009-05-22 : 14:03:42
Yes, i need to

select * from table where a column element appears only once.

for example, I want to grab the all the customers that have purchased only one thing from my store

Transaction Table
Customer|TransactionID|etc..|

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2009-05-22 : 14:18:09
Someting like:
SELECT Customer
FROM MyTable
GROUP BY Customer
HAVING COUNT(*) = 1
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-05-22 : 14:22:34
one thing or one occurance of a thing?
Go to Top of Page

suarezst1984
Starting Member

16 Posts

Posted - 2009-05-22 : 16:14:27
Thanks Lamprey, worked great. Ye I just wanted the customers that have been to my store only once.. So if they made a purchase from me more than once they would appear multiple times in my transaction table. :)
Go to Top of Page
   

- Advertisement -