I have a table with codes for multilingual commands with a structure like this:
id | code | lang | text |
---|---|---|---|
1 | exit_command | de | Fenster Schliessen |
2 | exit_command | en | Close window |
....
(The column lang
also contains other languages such as Italian, Japanese, etc.)
I want to extract all texts for German and English from that table sorting them by code. Running the command below, I get a mix of German and English in the same column:
SELECT * FROM table WHERE (lang='de' or lang='en')
But I would like to have a column for lang=English with English Text in a separate column and a column for lang=German with German Text in a separate column.
The structure of the output should look like this:
code | lang | German text | lang | English text |
---|---|---|---|---|
exit_command | de | Fenster schliessen | en | Close window |
...
How can I get this output with an SQL query? Thank you for your help!