CodePudding user response:
Declare @ a int, int, @ b @ c int
The set @ a=12
The set @=7 b
Set @ 9 c=
Select the id from
(
Union all select @ a as id
Union all select @ b
Select @ c
) a
The order by id desc
/*
Id
-- -- -- -- -- -- -- -- -- -- --
12
9
7
(3 rows affected)
*/
CodePudding user response:
Thank you, love!!CodePudding user response:
Use nor IF statements like it