首先在in(子查询)用法使用order by 会报错,其次,子查询里用order by,纯属多此一举,子查询的目的,只是找出合适的数据。如果需要排序,在外边排即可。
示例如下:
Select * fromTABEL_EXAMPLE where ID in(select ID from TABLE_EXAMPLE where ID>500 oder byID DESC)
解决方案如下:
Select * fromTABEL_EXAMPLE where ID in(select ID from TABLE_EXAMPLE where ID>500)oder by ID DESC