0
Good afternoon, I am making a system of equipment scheduling, for better understanding I will put on topics some important information.
- Each schedule has a numbering of the equipment that will be used in that time range.
- Two devices cannot be used at the same time.
- Each piece of equipment has specific software installed on it (it may be installed on more than one piece of equipment).
And for that I am dealing with a function. (My function is a mess and the shame of posting here) This function is avoiding conflicts but is still having some problems.
I was trying to do a query to select Cars that CONTAIN X Software and are not being used on the current day
SELECT DISTINCT ls_software.* FROM ls_agendamentos INNER JOIN ls_software ON ls_agendamentos.data = '2016-12-01' AND ls_software.carro != ls_agendamentos.carro AND ls_software.nome = 'avocado'
This was the attempt, but this query returns all the cars that are being used today
Follow the photo of the tables for a better example understanding.

