MySQL, select from different table... IF
- by gubbfett
I'm having a small trouble since it was a long time ago i studies databases and querys.
For example i'll have two tables for cd:s, one with data and one with alternative translations.
In the CD-table i have the original language, and it looks something like this
Table for CDs (cds):
id | name | language
-----------------------
1 | aaa | en
2 | bbb | en
3 | ccc | fi
Table for languages (languages):
cd_id | language | name
-----------------------
1 | fi | AAA
1 | de | AAACHTUNG
3 | en | CCC
Now, i want to get all these cd:s in for example german, if there's no translation made i want it to be in the original language...
How can i do this?