I need to make a query
in mysql
, within the WHERE
I need that is containing COD_IDENT
within a group. That is:
COD_IDENT
5
6
7
My query
must return all results where COD_IDENT
is equal to 5,6,7
I tried to do using in
however it returns only one result. Actually, it was back to two.
I did it this way:
SELECT COD_IDENT_REUNI, COD_IDENT_SALAX
FROM tbl_REUNIOES WHERE COD_IDENT_EMPRE = 'ibhr' and COD_IDENT_SALAX in
(SELECT COD_IDENT_SALAX, max(DAT_IDENT_REUNI)
FROM tbl_REUNIOES WHERE COD_IDENT_EMPRE = 'ibhr' GROUP BY (COD_IDENT_SALAX))