I have two tables with milions of records that I need to join to display results in different languages. I wish to create a view using a query with IF conditions but I'm not able to understand which is the right way.
What I need to do is: if the following select has a NULL for a single row (in other words the row doesn't have a deutsch translation)...
SELECT one, two FROM tableA A LEFT JOIN tableB B ON (A.id=B.id) WHERE language='de' order by xyz
...then take the english version for the same row and so do this select:
SELECT one, two FROM tableA A LEFT JOIN tableB B ON (A.id=B.id) WHERE language='en' order by xyz
Thanks! Luca