SQL Server order by with max rows in subquery -
the following query works postgresql , i'd know why doesn't work sql server 2016.
select * (values (1),(2)) a(a) union ( select * (values (1),(2)) a(a) order 1 desc offset 0 rows fetch first 1 rows ) order 1 desc offset 0 rows fetch first 1 rows
can explain me why order not supported here?
funny following, way express this, works charm
select * (values (1),(2)) a(a) a.a in( select * (values (1),(2)) a(a) order 1 desc offset 0 rows fetch first 1 rows ) order 1 desc offset 0 rows fetch first 1 rows
is bug?
the query after union needs presented select, so:
select * (values (1),(2)) a(a) union select * ( select * (values (1),(2)) a(a) order 1 desc offset 0 rows fetch first 1 rows ) b order 1 desc offset 0 rows fetch first 1 rows
Comments
Post a Comment