union不能用order by,会报错

union不能用order by,会报错

select t1.*
  from  person t1
  where t1.id='1c06b213661149619c3e0dcf46f4b14b'
 order by t1.create_time 
union all
select t1.*
  from  person t1
  where t1.id!='1c06b213661149619c3e0dcf46f4b14b'

 order by t1.create_time ;


这样是会报错的,union不能和order by结合使用。


猜你喜欢

转载自blog.csdn.net/ideality_hunter/article/details/80598151
今日推荐