___________________
| field1 | field1 |
|________|________|
| A | E |
| B | D |
| C | C |
| D | B |
| E | A |
|________|________|
If possible I do the sql selection like upside table with same field same table?
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?