最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

database_leetcode 2159 Order Two Columns Independently

2022-02-16 20:20 作者:您是打尖兒還是住店呢  | 我要投稿


Table: Data

+-------------+------+

| Column Name | Type |

+-------------+------+

| first_col ? | int ?|

| second_col ?| int ?|

+-------------+------+


There is no primary key for this table and it may contain duplicates.

?

Write an SQL query to independently:

order first_col in ascending order.

order second_col in descending order.

The query result format is in the following example.

?

Example 1:

Input:

Data table:

+-----------+------------+

| first_col | second_col |

+-----------+------------+

| 4 ? ? ? ? | 2 ? ? ? ? ?|

| 2 ? ? ? ? | 3 ? ? ? ? ?|

| 3 ? ? ? ? | 1 ? ? ? ? ?|

| 1 ? ? ? ? | 4 ? ? ? ? ?|

+-----------+------------+

Output:

+-----------+------------+

| first_col | second_col |

+-----------+------------+

| 1 ? ? ? ? | 4 ? ? ? ? ?|

| 2 ? ? ? ? | 3 ? ? ? ? ?|

| 3 ? ? ? ? | 2 ? ? ? ? ?|

| 4 ? ? ? ? | 1 ? ? ? ? ?|

+-----------+------------+

*/


Create table Data (first_col int, second_col int)

Truncate table Data

insert into Data (first_col, second_col) values ('4', '2')

insert into Data (first_col, second_col) values ('2', '3')

insert into Data (first_col, second_col) values ('3', '1')

insert into Data (first_col, second_col) values ('1', '4')

;

/* Write your T-SQL query statement below */


database_leetcode 2159 Order Two Columns Independently的評論 (共 條)

分享到微博請遵守國家法律
曲靖市| 定边县| 梁河县| 西乌珠穆沁旗| 连南| 都江堰市| 正镶白旗| 手游| 拉孜县| 太保市| 额济纳旗| 吴川市| 屏南县| 泉州市| 鄂托克旗| 恭城| 三穗县| 德州市| 东宁县| 宁陕县| 桦川县| 方正县| 扎囊县| 涿州市| 苍梧县| 讷河市| 伊川县| 军事| 汝城县| 交口县| 临武县| 水富县| 嵊泗县| 炉霍县| 太仆寺旗| 应城市| 图木舒克市| 蓬溪县| 安泽县| 泰和县| 东莞市|