Close

Not a member yet? Register now and get started.

lock and key

Sign in to your account.

Account Login

Forgot your password?

善用 ORDER BY 位置順序編號

16 三月 DB資料庫 | Comments

 

當 UNION ALL 匯集好幾個查詢語句,而偏偏要用來排序的欄位,
在各查詢語句中的欄位名又不一致時,
這時 ORDER BY 查詢結果中某一個欄位的位置順序編號,就很好用,
例如 ORDER BY 1

Leave a Reply

*