Click here to Skip to main content
15,902,939 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,


I have 3 columns (id,ParentDeviceId,ResellerId,IsPurchase) in a table. There can be 2 id corresponding to a parentid of same/diffrent resellerid and purchase.
i.e

ID ParentDeviceId ResellerId IsPurchase
------------------------------------------------------
1 100 580 1

2 100 580 0

3 100 600 0




Now i want to write a select statement that will get me rows that have same Ispurchase and parentdevice . ResellerId value is irrelevant.
Posted

1 solution

select count(*) from table group by Ispurchase, parentdevice will give you a count of all rows that have the same Ispurchased parentdevice.
 
Share this answer
 
Comments
Arjun Menon U.K 8-Apr-13 5:57am    
THANKS

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900