Registriert seit: 4. Nov 2005
Ort: Basel
442 Beiträge
Delphi XE2 Enterprise
|
Re: SQL sortierung / "eigne Definition"
24. Mär 2009, 16:52
zur Info
konnte es so Lösen:
SQL-Code:
SELECT
ID,
C_NO,
(CASE
WHEN CABINET_G = 'P'
THEN 1 ELSE 0 END ) CABINET_G_P,
(CASE
WHEN CABINET_G = 'VP'
THEN '2' ELSE 0 END ) CABINET_G_VP,
(CASE
WHEN CABINET_G = 'S'
THEN '3' ELSE 0 END ) CABINET_G_SEK,
(CASE
WHEN CABINET_G = 'T'
THEN '4' ELSE 0 END ) CABINET_G_T,
(CASE
WHEN CABINET_G = 'CH'
THEN '5' ELSE 0 END ) CABINET_G_CH
FROM MEMBER
WHERE
((MEMBER.CABINET_G IS NOT NULL )
AND
(C_NO = ?C_NO)
)
ORDER BY CABINET_G_P DESC, CABINET_G_VP DESC, CABINET_G_SEK DESC, CABINET_G_T DESC, CABINET_G_CH DESC
Shalom
Manfred
|
|
Zitat
|