On Sat, Aug 22, 2015 > afriendandmore wrote: > > The table shall be ordered according to A. (Order by A) > > But if C ist true and to the value B1 in this Record, there exists > another Record with B2 and B2 = B1, then B1 should be ordered in the row > above B2.
If the B1 and B2, to which you refer, are just two equal values in different rows of column B, then it sounds like you want: SELECT * FROM table ORDER BY columnA, columnB CASE WHEN columnC = 1 THEN 0 ELSE 1 END; If neither ASC or DESC are specified, rows are sorted in ascending (smaller values first) order by default. -- -- -- --???-- K e V i N