union all 两边的sql不可以用排序了吗
我现在用这sql实现
select * from e_pinpai where renzheng=1 order by impath desc
============================
由于 最近 有些用户没有发图片 所以会出现不美观的问题
我现在想根据用户的发布时间来排序,如果正好用户没有发图片但是是最新发布滴也要显示到后面.
!也就是说优先显示有图片的用户信息
(select * from e_pinpai where renzheng=1 and impath<>'' order by zjsxshijian desc union all select * from e_pinpai where renzheng=1 and impath='' order by zjsxshijian desc) order by impath desc
用上面的语句会出错
===服务器: 消息 156,级别 15,状态 1,行 1
在关键字 'order' 附近有语法错误。
服务器: 消息 170,级别 15,状态 1,行 1
第 1 行: ')' 附近有语法错误。
请指教 应该用一条什么sql语句来实现