Problem: 
If you want to provide a selection list, i.e. for a report, you may want to have an 'All' entry always on top of the list.
Solution:
SELECT Name FROM (
    SELECT 'All'       as Name
    UNION 
    SELECT DISTINCT    Item
    FROM               List
) T
ORDER BY CASE Name WHEN 'All' THEN 0 ELSE 1 END, Name
Abonnieren
Kommentare zum Post (Atom)
 
Keine Kommentare:
Kommentar veröffentlichen