Einzelnen Beitrag anzeigen

Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#2

AW: Inhalt einer Tabelle als neue Felder

  Alt 7. Jul 2016, 16:49
Ungefähr so
SQL-Code:
SELECT
  k.Key as Pers,
  nachn.Value as Name,
  nr.Value as Nummer,
  an.Value as Anrede,
  g.Value as Geschlecht
FROM ( select distinct Key from table1 ) k
JOIN ( select Key, Value from table1 where Attribut='P0002-NACHN' ) nachn ON nachn.Key=k.Key
JOIN ( select Key, Value from table1 where Attribut='P0002-Nr' ) nr ON nr.Key=k.Key
JOIN ( select Key, Value from table1 where Attribut='P0002-An' ) an ON an.Key=k.Key
JOIN ( select Key, Value from table1 where Attribut='P0002-G' ) g ON g.Key=k.Key
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  Mit Zitat antworten Zitat