A working MySQL-query had to be extended due to the inclusion of a new column in the underlying tables. This column is also now relevant for a condition in the query, therefore I tried to adjust the query with the inclusion of the new column in the condition part by using CONCAT, but without luck so far, meaning I do not get any results.
After trying now for quite a while and also looking e.g. here Using mysql concat() in WHERE clause? , I cannot get it to work aka the query does give an empty result.
When I try the individual parts of the query alone, everything works fine...
this worked:
SELECT a, ... FROM tbl1
LEFT JOIN(
SELECT a, ... FROM tbl2) AS tbl3 using (a)
WHERE a
NOT IN (SELECT a FROM tbl4 where con=...)
this does not:
SELECT a, b , ... FROM tbl1
LEFT JOIN(
SELECT a, b, ... FROM tbl2) AS tbl3 using (a)
WHERE CONCAT(a, b)
NOT IN (SELECT CONCAT(a, b) FROM tbl4 where con=...)
Expected query result should be the result of the JOIN, filtered by the NOT IN condition. Instead I get an empty query result.