Thema: Delphi select statement

Einzelnen Beitrag anzeigen

nahpets
(Gast)

n/a Beiträge
 
#16

Re: select statement

  Alt 16. Jun 2009, 10:55
Hallo,

hilft Dir das?
SQL-Code:
select Rezept, Sum(Si) As Si, Sum(Fe) as Fe, Sum(Cu) As Su from (
  select Rezept, Element,
    case Element when 'Sithen wert else 0 end as Si,
    case Element when 'Fethen wert else 0 end as Fe,
    case Element when 'Cuthen wert else 0 end as Cu
  from Rezepte
  where gruppe = 'ABCand Rezept in ('Si','Fe','Cu')
) intern
group by rezept
  Mit Zitat antworten Zitat