[英]Setting the 'Order By' Clause from plsql procedure parameters
從傳入plsql過程的參數動態設置'order by'列名稱和方向的最佳方法是什么?
如果您使用案例訂購,則可以使用變量:
select *
from YourTable
order by
case when par_name = '1' then col1
when par_name = '2' then col2
end
, case when par_name = '3' then col3
end desc
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.