Thema: Delphi SQL Oder BY Problem

Einzelnen Beitrag anzeigen

omata

Registriert seit: 26. Aug 2004
Ort: Nebel auf Amrum
3.154 Beiträge
 
Delphi 7 Enterprise
 
#7

Re: SQL Oder BY Problem

  Alt 10. Feb 2007, 18:46
Mit ORDER BY kommt eine Fehlermeldung?

Versuch es mal so...
SQL-Code:
SELECT *
FROM (SELECT 1 AS typ, id, picture
      FROM pictures
      WHERE id = 52

      UNION

      SELECT 2 AS typ, id, picture
      FROM pictures
      WHERE id = 18

      UNION
 
      SELECT 3 AS typ, id, picture
      FROM pictures
      WHERE id = 36) x
ORDER BY typ
Es ist sicherer wenn das ORDER BY auch vorhanden ist.

Gruss
Thorsten
  Mit Zitat antworten Zitat