Good afternoon, I am doing a system of scheduling equipment, for better understanding I will put in topics some important information.
And for this I'm dealing with a function. (My job is a mess and the embarrassment of posting here) This function is preventing conflicts but is still having some problems.
I was trying to query to select Cars that CONTAIN Software X and that are not being used on the current day
SELECT DISTINCTls_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, however this query returns all the cars that are being used today
Follow the photo of the tables for a better understanding example.