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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -