By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
select @@version;
(No column name) |
---|
Microsoft SQL Server 2014 (SP3-CU-GDR) (KB4535288) - 12.0.6372.1 (X64) Dec 12 2019 15:14:11 Copyright (c) Microsoft Corporation Express Edition (64-bit) on Windows NT 6.3 <X64> (Build 17763: ) (Hypervisor) |
create table Table2(FieldA Integer,FieldB Integer)
insert into Table2 values(1,2);
1 rows affected
insert into Table2 values(1,3);
1 rows affected
select * from Table2;
FieldA | FieldB |
---|---|
1 | 2 |
1 | 3 |
Select * from (select FieldA,FieldB from Table2 union select null,null) tab order by FieldA Desc
FieldA | FieldB |
---|---|
1 | 2 |
1 | 3 |
null | null |