1
我只想修整字符串中最右邊的兩個字符。如何在Oracle中修整右邊的兩個字符/字符串
這裏是我要修剪的字段中的代碼:
`ROUND(ifsapp.customer_order_api.get_gross_amt_incl_charges(c.order_no), - 2))
例如,如果api調用返回1136,則它將輪到1100.我希望最終結果返回'11'
我在SSRS查詢編輯器中。
我只想修整字符串中最右邊的兩個字符。如何在Oracle中修整右邊的兩個字符/字符串
這裏是我要修剪的字段中的代碼:
`ROUND(ifsapp.customer_order_api.get_gross_amt_incl_charges(c.order_no), - 2))
例如,如果api調用返回1136,則它將輪到1100.我希望最終結果返回'11'
我在SSRS查詢編輯器中。
本應該做的工作
SELECT SUBSTR('your string',1,2) FROM dual;
或詳細
substr(ROUND(ifsapp.customer_order_api.get_gross_amt_incl_charges(c.order_no),-2)),1,2)
您可以通過100除以你的電話號碼,以規模移位,輪結果:
ROUND(ifsapp.customer_order_api.get_gross_amt_incl_charges(c.order_no)/100))
用一些演示值:
with t(x) as (
select 1136 from dual
union all select 145 from dual
union all select 98765 from dual
)
select x, round(x/100) as y
from t;
X Y
-------- --------
1136 11
145 1
98765 988