David_Zhu

导航

 

一。union all 的用法。使用union all 或者 union
select * from rental where rental_id <10
union all
select * from rental where rental_id >30 and rental_id <40

二。disctinc 的用法
select distinct * from (
select "abc","41",3.12
union all
select "def","41",3.13
union all
select "abc","41",3.12

) a;

Total MapReduce CPU Time Spent: 7 seconds 570 msec
OK
abc 41 3.12
def 41 3.13
Time taken: 36.445 seconds, Fetched: 2 row(s)

//注意:union all 句子总不能使用order by limit这些关键字

posted on 2018-12-20 11:36  David_Zhu  阅读(255)  评论(0)    收藏  举报