Du kan fortfarande göra CASE
uttalande även i ORDER BY
klausul,
SELECT *
FROM tableName
ORDER BY (CASE WHEN DATE(dateColumn) < DATE(GETDATE())
THEN 1
ELSE 0
END) DESC, dateColumn ASC
Du kan fortfarande göra CASE
uttalande även i ORDER BY
klausul,
SELECT *
FROM tableName
ORDER BY (CASE WHEN DATE(dateColumn) < DATE(GETDATE())
THEN 1
ELSE 0
END) DESC, dateColumn ASC