union: select user_id from uauth_userinfo union select price from shop;
union all: select user_id from uauth_userinfo union all select user_id from uauth_unreadcount;
把union all聯合後的數據當作一般的select後的數據進行處理的方法:
把整個數據用小括號()擴起來,後面加上 as name2 不寫as也可以
select user_id,count() from (select user_id from uauth_userinfo union all select user_id from uauth_unreadcount) as a group by user_id order by count();