can i in 1 select count all the values of a field that say equals 35
and how many are not?
thnaks in advance
peleg
counting diffrent values of a field
Moderator: General Moderators
Try this
FIRST you weren't clear is this MySQL table field or form processing textfield
Select count(column_name) from table_name where colum_name2='35' OR colum_name2<>'35';
OR you can use != instead of <>
Now you got the results, but decide on grouping to make them of any use for you
FOR EX.
//add this in the end of the MySQl statement
GROUP BY column_name2
Do report if this was usefull
Select count(column_name) from table_name where colum_name2='35' OR colum_name2<>'35';
OR you can use != instead of <>
Now you got the results, but decide on grouping to make them of any use for you
FOR EX.
//add this in the end of the MySQl statement
GROUP BY column_name2
Do report if this was usefull
Last edited by Calimero on Sun Jun 27, 2004 10:40 am, edited 1 time in total.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
tryseems to work for me..
Code: Select all
SELECT column_name, COUNT( column_name ) count FROM table_name GROUP BY column_name