Einzelnen Beitrag anzeigen

Dumpfbacke

Registriert seit: 10. Mär 2005
Ort: Mitten in Deutschland
329 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#8

AW: Bestimmt Datensätze anzeigen

  Alt 4. Jul 2013, 19:05
Code:
select
  distinct
  id, (select max(y.wert) from test y where y.id = t.id) as wert
  from test t
  where not exists(select x.id from test x where x.id = t.id and x.wert is null)
oder

Code:
select
  t.id
, max(t.wert) as wert
  from test t
  where not exists(select x.id from test x where x.id = t.id and x.wert is null)
  group by t.id
Test natürlich in deinen Tabellennamen ändern.

Frank
Funktioniert leider beides nicht.
Tanja
Tanja
  Mit Zitat antworten Zitat