首先在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