Given these two simple queries:
SELECT materialID FROM materials WHERE compoundNumber = "<some user input1>";
SELECT materialID FROM materials WHERE vendorCompoundNumber = "<some user input2>";
How can I make them into one query with the result set look something like this:
materialID | compoundDupFound | vendorCompoundDupFound 1 | 0 | 1 - - or - - 2 | 1 | 0 - - or - - 3 | 1 | 1
I realize I can perform one then the other but I'm wondering if there is a clever built in way to construct a query to do both at once.
The columns compoundNumber & vendorCompoundNumber need to be unique in the database so I'm checking a form and making sure the user inputs something unique. I will display an error message based on the result set.