One needs to load the attached dataset, then run this query:
SELECT table2 . `col_int_key` AS field1
FROM (
CC AS table1
RIGHT OUTER JOIN
(
( C AS table2 STRAIGHT_JOIN
C AS table3 ON ( (table3.col_varchar_nokey = table2.col_varchar_key ) AND (table3.pk = table2.col_int_key))
)
) ON
(
(table3.col_varchar_key = table2.col_varchar_key) OR
(table3.col_int_key = table2.pk)
)
)
HAVING field1 < 216;
Ok, there is a repeatable single-query scenario:
One needs to load the attached dataset, then run this query:
SELECT table2 . `col_int_key` AS field1
(table3. col_varchar_ nokey = table2. col_varchar_ key ) AND
(table3. pk = table2. col_int_ key)) table3. col_varchar_ key = table2. col_varchar_ key) OR table3. col_int_ key = table2.pk)
FROM (
CC AS table1
RIGHT OUTER JOIN
(
( C AS table2 STRAIGHT_JOIN
C AS table3 ON (
)
) ON
(
(
(
)
)
HAVING field1 < 216;