I have to make a query that consists of checking if the start date that they insert me and the end date that they insert me is not included in another existing article, that is:
Artículo {
Id:1
Nombre:'mesa'
F_ini: 1/7/2018
F_fin : 31/7/2018
}
So if I want to insert a chair, it can not be between 1 and 31, that is:
F_ini 29/7/2018
F_fin 8/8/2018
does not work for me because the start is understood,
The same thing happens with the end date 25/6/2018
end date - 29/7/2018
, the end date is inside the block.
Finally 1/1/2018
- 31/12/2018
It's not good either, because the other date was included inside it.
Select * from articulos where F_ini > fecha_inicio and f_fin < fecha_fin;
The problem is that this does not work for me because I can not check the 3 types of cases and I do not know how to do it ...