MySQL: COUNTS with more WHERE`s in 1 query -
Is it possible to do this:
  as user from user name SELECT COUNT (user name) WHERE user name = 'Piet'; Choose as email in the form of email (email) from where email = 'piet@google.nl'; Select COUNT (ip_registed) IP from users where IP = '127.0.0.1';    In a question (hence without subqueries)?   
 
  Yes you can use  SUM ()  You should do, using yoga with expression will result in a boolean 1 or 0, so when your expression evaluates the truth, then you will get it count accordingly, whenever the gross working group is used without As a result they will be on one line, and consider the entire table as a group    SELECT SUM (username = 'Piet') as the user name, in the form of SUM (email = 'piet @ google.nl'), as SUM (ip = '127.0.0.1') IP to users    
 
Comments
Post a Comment