samedi 19 décembre 2015

SELECT query for two variables in the same table

I am asking you how can I mimic this logic in SQL:

SELECT var1, var2 FROM table1,WHERE var1 = COUNT(table1.status == 1) AND var2 = COUNT(table2.status == 2)

I want to store in var1 the number of entries that have status = 1 and in var2 the number of entries which have status = 2 in a single SELECT.

Aucun commentaire:

Enregistrer un commentaire