0
I need to select one in an offer table and then use an except to delete the other select result
Example:
A = {10,11,12} B = {11,12} (A except B) = {10}
I’m talking about except pq for what I had searched for, sure the code below in sql server but I wanted a similar code in mysql or if possible it can be something in php
SELECT ofe.ofeCodigo, ofe.ofeTitulo FROM tbloferta ofe, tblcategoriaoferta cof WHERE ofe.cofCodigo = cof.cofCodigo AND ofe.ofeStatus = 'Aberto' AND cof.cofDescricao = 'Compra'
EXCEPT
SELECT ofe.ofeCodigo, ofe.ofeTitulo FROM tbloferta ofe, tblofertanegociacao ofeneg, tblcategoriaoferta cof WHERE ofe.ofeCodigo = ofeneg.ofeCodigo AND ofe.cofCodigo = cof.cofCodigo AND ofeneg.negCodigo = 40 AND cof.cofDescricao = 'Compra'
I believe that Mysql does not implement the combination operations of EXCEPT and INTERSECT queries, only UNION.
– anonimo