Registriert seit: 7. Jul 2016
4 Beiträge
|
AW: Inhalt einer Tabelle als neue Felder
7. Jul 2016, 18:34
Klappt nicht:
Msg 156, Level 15, State 1, Line 6
Incorrect syntax near the keyword 'FROM'.
Msg 102, Level 15, State 1, Line 6
Incorrect syntax near 'k'.
Msg 102, Level 15, State 1, Line 7
Incorrect syntax near 'nachn'.
Msg 102, Level 15, State 1, Line 8
Incorrect syntax near 'an'.
SELECT
k.[Key] as Pers,
nachn.[Value] as Name,
an.[aValue] as Anrede,
FROM ( select distinct [Key] from [mxmc_db].[dbo].[table1] ) k
JOIN ( select Key, aValue_neu FROM [mxmc_db].[dbo].[table1] where AttrName='P0002-NACHN' ) nachn ON nachn.Key=k.Key
JOIN ( select Key, Value FROM [mxmc_db].[dbo].[table1] where AttrName='P0002-TEXT_P0002_ANRED' ) an ON an.Key=k.Key
Geändert von llaprosper ( 7. Jul 2016 um 18:36 Uhr)
|