Je kunt nog steeds CASE
. doen statement zelfs in ORDER BY
clausule,
SELECT *
FROM tableName
ORDER BY (CASE WHEN DATE(dateColumn) < DATE(GETDATE())
THEN 1
ELSE 0
END) DESC, dateColumn ASC
Je kunt nog steeds CASE
. doen statement zelfs in ORDER BY
clausule,
SELECT *
FROM tableName
ORDER BY (CASE WHEN DATE(dateColumn) < DATE(GETDATE())
THEN 1
ELSE 0
END) DESC, dateColumn ASC