I need some help. I googled for solution, but I didn't found one.
I have three tables:
langs
(int) id | (varchar) language
1 | English
2 | Latin
3 | Esperanto
... | ...
keys
(int) id | (varchar) keys
1 | dog
2 | cat
... | ...
value
(int) id | (int) key_id | (int) lang_id | (varchar) value
1 | 1 | 1 | Dog
2 | 1 | 2 | Canis
3 | 2 | 1 | Cat
4 | 2 | 2 | Felis
5 | 2 | 3 | Kato
... | ... | ... | ...
and I want to get the result:
key_id | keys | English | Latin | Esperanto
1 | dog | Dog | Canis | NULL
2 | cat | Cat | Felis | Kato
... | ... | ... | ... | ...
merging rows with equal key_id
. I know I can try to make it with multiple JOINs, but it's slow and I must know the exact number of different langs
.
Thanks in advance. :)