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.
| Author |
Topic |
|
kapinjal
Starting Member
2 Posts |
Posted - 2002-03-20 : 09:09:10
|
| hi guys..its not much complicated..but i m confused..i got a table "purchase" with fieldspurchid,fk_memberid,fk_prodid, price,purchdate,receiptfk_memberid is a foreign key to member tablefk_prodid is a foreign key to product tablenow if a memberid = 1 is for instance Jack buy a "shirt" (fk_prodid = 20)on 01/01/2002, again 12/02/2002 & 20/03/2002i got few members who buy the same product at different time!!now i want to find such users details from purchases table ...i guess i made it pretty clear...any help out there?cheers |
|
|
davidpardoe
Constraint Violating Yak Guru
324 Posts |
Posted - 2002-03-20 : 09:15:51
|
| select fk_member_id,fk_prodid,count(*) from purchasegroup by fk_member_id,fk_prodidhaving count(*)>1============The Dabbler! |
 |
|
|
|
|
|