In my table I have 3 columns:
- % auto_default%
-
id(INT)
: values aretipo(INT)
or1
-
2
I need a medium without the id_usuario(INT)
at the end to know if there is a specific data of the user, and if there is a data of it, it displays WHERE
if it is tipo(INT)
or 1
. >
I can not use 2
at the end because I'm doing a count of the data together. What I currently have:
SELECT
COUNT(IF(tipo = 1, 1, NULL)) AS X,
COUNT(IF(tipo = 2, 1, NULL)) AS W,
COUNT() AS y, -->Conte se existe um dado do usuário especifico na tabela.
tipo AS Z -->Mostrar dado do usuário especifico se é 1 ou 2.
FROM tabela WHERE id='$id'