Web Hosting Talk







View Full Version : count function in mySQL


Netstarhost
09-28-2001, 10:32 PM
I have a colume with letters G,N.Y,and R I'm using the "count " function to list how many of each are in the colume....SELECT COUNT(CHANGECODE)
FROM datafare
WHERE CHANGECODE = 'S'
then I have to display the diffrence between lets say "S" - "R" ="X" the result I need.
how do you display the diffrence ?

jks
09-29-2001, 07:23 AM
Originally posted by Netstarhost
I have a colume with letters G,N.Y,and R I'm using the "count " function to list how many of each are in the colume....SELECT COUNT(CHANGECODE)
FROM datafare
WHERE CHANGECODE = 'S'
then I have to display the diffrence between lets say "S" - "R" ="X" the result I need.
how do you display the diffrence ?

Do two selects and substract the results?