返回数说广场
1
查看此SQL语句,选择三个正确答案确认可以使查询成功执行的ORDER BY子句(ABD)
SELECT cust_id, cust_last_name "Last Name"
FROM customers
WHERE country_id = 10
UNION
SELECT cust_id CUST_NO, cust_last_name
FROM customers
WHERE country_id = 30;
A、ORDER BY 2, 1
B、ORDER BY "Last Name"
C、ORDER BY "CUST_NO"
D、ORDER BY 2,cust_id
E、ORDER BY CUST_NO
解析:
drop table customers;
create table customers(cust_id int,country_id int,cust_last_name varchar(20));
insert into customers values(1,10,'Oracle');
insert into customers values(2,30,'MySQL');
commit;
SQL> SELECT cust_id, cust_last_name "Last Name"
2 FROM customers
3 WHERE country_id = 10
4 UNION
5 SELECT cust_id CUST_NO, cust_last_name
6 FROM customers
7 WHERE country_id = 30;
CUST_ID Last Name
---------- --------------------
1 Oracle
2 MySQL
0
1 191
分享
评论
热门数说



