-1
I would like to know which ids are not present in certain groups for a certain period of time. For example:
SELECT id from table1
Results in the following exit:
id
1
2
3
4
5
And the consultation :
select Id, DateStart,DateFinish from table2
group by DateStart,DateFinish, Id
order by Id, DateStart
Results in :
Id DateStart DateFinish
1 2017 2019
2 2017 2019
3 2017 2019
2 2014 2016
4 2014 2016
The output I want to know is which ids of Tabela1 are not in the respective groupings of table2?
The desired exit would be something like:
id DateStart DateFinish
4 2017 2019
5 2017 2019
1 2014 2016
3 2014 2016
5 2014 2016
Friend, your example got a little confused, I answered based on what I could interpret, in case you missed something please let me know in the comments so that I can adjust my answer.
– Neto Costa