我有一份国家清单
SELECT * FROM COUNTRIES
COUNTRY
--------------
Austria
Belarus
Belgium
Finland
France
Iceland
Ireland
Switzerland
Run Code Online (Sandbox Code Playgroud)
我如何选择2列,例如
COLUMN1 COLUMN2
------- -------
Austria Belarus
Belgium Finland
France Iceland
Ireland Switzerland
Run Code Online (Sandbox Code Playgroud)
谢谢.
select country, next_country
from
(select country,
lead(country) over (order by country) next_country,
row_number() over (order by country) rnk
from countries
)
where mod(rnk,2)=1;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
118 次 |
| 最近记录: |