lundi 29 décembre 2014

Get the pais_id not associated to fabricante_distribuidor_id and producto_solicitud_id, the opposite from SELECT query


I have this query for get all the pais_id given a fabricante_distribuidor_id and producto_solicitud_id, the query works fine.



SELECT DISTINCT
nomencladores.pais_fabricante_producto_solicitud.pais_id
FROM
negocio.fabricante_producto_solicitud
INNER JOIN nomencladores.pais_fabricante_producto_solicitud ON (negocio.fabricante_producto_solicitud.id = nomencladores.pais_fabricante_producto_solicitud.fabricante_producto_solicitud_id)
WHERE
negocio.fabricante_producto_solicitud.fabricante_distribuidor_id = 1 AND
negocio.fabricante_producto_solicitud.producto_solicitud_id = 1


But I want to get the opposite, I mean all the pais_id that does not associated to fabricante_distribuidor_id and producto_solicitud_id, how?





Aucun commentaire:

Enregistrer un commentaire