0
I have the following table:
results
idRes(int) | idEmp(int) | data(varchar[8]) | resultado(text)
------------------------------------------------------------------
1 | 1 | 20200220 | (xml em texto)
2 | 1 | 20200221 | (xml em texto)
3 | 2 | 20200220 | (xml em texto)
I’m trying to find the company ids (in this case, idEmp = 1) that got results on 20/02/2020 (date = 20200220) E 21/02/2020 (date = 20200221)
I’m a little lost in how to do it. I know that
select idEmp Where data in ('20200220' and '20200221')
does not work, but I do not know how to proceed or correct.
We didn’t have the idea to create the field as date or timestamp, and in this format we found it easier to sort the date (20200221 comes before 20200220, etc.). I’ll test your suggestion.
– Pedro Nassetti
A form select idEmp Where data in ('20200220','20200221') group by idEmp having Count(distinct data) = 2
– Motta