Click here to Skip to main content
15,903,385 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
i have a table with values as below
UserID  Make1    Make2   Make3   Make4   Make5
1       Maruti
2               Maruti
3                       Maruti
4                               Maruti
5                                       Maruti

how can i found the count of users having Maruti as their Make

I mean i need count Maruti(5)

Please help me..
Thanks in advance
Posted
Updated 20-Jun-12 20:24pm
v2

 
Share this answer
 
Comments
Manas Bhardwaj 21-Jun-12 4:48am    
Good one +5!
Prasad_Kulkarni 21-Jun-12 4:52am    
;) Thank You Manas!
Try:
SQL
SELECT COUNT(UserID) WHERE Make1='Maruti' OR Make2='Maruti' OR Make3='Maruti' OR Make4='Maruti' OR Make5='Maruti'
 
Share this answer
 
Comments
ssd_coolguy 21-Jun-12 13:08pm    
good one answer...

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