I need to return a column from
if a column in
, which has the same identifier with a different column name, has a
in a specific field.
In this example I would like to retrieve
, but only if
I've come to a point where I'm thinking it's actually impossible, I've tried numerous inline queries and
variants but nothing seems to be able to actually perform the task. Writing out all the versions I've tried is pointless as none of them have worked, but an example would be:
SELECT item_code FROM table1 WHERE alt1 = "888"
AND (SELECT item FROM table2 WHERE item = "222" AND alt1 = 1)
The above is probably not the best example of something I've tried, but since none of them have worked so far it doesn't really matter. Any help is greatly appreciated.