I have two tables LANGUAGE:
CREATE TABLE LANGUAGE
(
LANGUAGE_ID nvarchar(10)
);
INSERT INTO LANGUAGE (LANGUAGE_ID)
VALUES ('de-DE'), ('en-EN'), ('de-US'), ('fr-FR'), ('es-ES');
and a table TRANSLATION which contains all translations of a TEXT_ID in several languages:
CREATE TABLE TRANSLATION
(
TEXT_ID nvarchar(20),
LANGUAGE_ID varchar(10),
TRANSLATION varchar(200)
);
INSERT INTO TRANSLATION (TEXT_ID, LANGUAGE_ID, TRANSLATION)
VALUES
('wire', 'de-DE', 'Draht'),
('wire', 'en-EN', 'Wire'),
('wire', 'en-US', 'Wire'),
('wire', 'fr-FR', 'fr:Draht'),
('wire', 'es-ES', 'es:Draht'),
('brush', 'de-DE', 'Buerste'),
('brush', 'en-EN', 'Brush'),
('brush', 'en-US', 'us_Brush'),
('screw', 'en-US', 'Screw');
As a result I want to get a list of all translations of a TEXT_ID in a single row:
TEXT_ID de-DE en-EN en-US fr-FR es-ES
--------------------------------------------------------------------
wire Draht Wire Wire fr:Draht es:Draht
brush Buerste Brush us_Brush
screw Screw
Is there a pure SQL way to do that?
Currently I am using SQL Server. But potentially we want to migrate to another database.