MySQL Forums
Forum List  »  General

Re: ignore LEFT JOIN when is a empty field, is possible?
Posted by: Peter Brawley
Date: July 13, 2021 04:24PM

Assuming d.contact is a string, is this what you mean?

SELECT *
FROM oficial.tc_devices AS d
LEFT JOIN cadastro_veiculo AS f ON d.contact = f.hinova_placa
WHERE !ISNULL(d.contact) AND d.contact <> ""
ORDER BY 1;

If d.contact is default null or numeric, omit ...AND d.contact <> ""...

I added a rudimentary Order By clause because otherwise row order in the resultset would be arbitrary.

Options: ReplyQuote


Subject
Written By
Posted
Re: ignore LEFT JOIN when is a empty field, is possible?
July 13, 2021 04:24PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.