I would like to - depending on the value of a column in table1 - either perform several joins or alternatively only display the contents of the main table1.
Unfortunately I don't get it. Here is my thought:
SELECT * FROM table1
CASE
WHEN table1.more = 1
THEN
LEFT JOIN table2 ON (table1.xyz= table2.xyz)
LEFT JOIN table3 ON (table2.aaa= table3.aaa)
ELSE
END
WHERE
CASE
WHEN table1.more = 1
THEN table2.xyz = 12345
ELSE
table1.something = 1
Can someone help?