___________________ | field1 | field1 | |________|________| | A | E | | B | D | | C | C | | D | B | | E | A | |________|________|
If possible, am I making a choice of sql, for example, at the top of a table with the same table of fields?
select t1.c, t2.c from ( WITH cte AS ( SELECT c, ROW_NUMBER() OVER(ORDER BY c DESC) AS n, ROW_NUMBER() OVER(ORDER BY c ASC) AS m FROM @t ) SELECT t1.c, t2.c FROM cte t1 JOIN cte t2 ON t2.n = t1.m )
Can I do something like this?
sql
user2594443
source share