數字欄位小數點超過兩位,則取到小數第二位,若不足小數兩位,則顯示原數字。
select name,
case when substr(to_char(floor(attribute1*100)/100),1,1) = '.'
then '0'||to_char(floor(attribute1*100)/100)
when substr(to_char(floor(attribute1*100)/100),1,2) = '-.'
then replace(to_char(floor(attribute1*100)/100),'-.','-0.')
else to_char(floor(attribute1*100)/100) end attribute1,
case when substr(to_char(floor(attribute2*100)/100),1,1) = '.'
then '0'||to_char(floor(attribute2*100)/100)
when substr(to_char(floor(attribute2*100)/100),1,2) = '-.'
then replace(to_char(floor(attribute2*100)/100),'-.','-0.')
else to_char(floor(attribute2*100)/100) end attribute2,
case when substr(to_char(floor(attribute3*100)/100),1,1) = '.'
then '0'||to_char(floor(attribute3*100)/100)
when substr(to_char(floor(attribute3*100)/100),1,2) = '-.'
then replace(to_char(floor(attribute3*100)/100),'-.','-0.')
else to_char(floor(attribute3*100)/100) end attribute3,
case when substr(to_char(floor(attribute4*100)/100),1,1) = '.'
then '0'||to_char(floor(attribute4*100)/100)
when substr(to_char(floor(attribute4*100)/100),1,2) = '-.'
then replace(to_char(floor(attribute4*100)/100),'-.','-0.')
else to_char(floor(attribute4*100)/100) end attribute4,
attribute6,to_char(date1,'yyyy/MM/dd') date1,to_char(date2,'yyyy/MM/dd') date2
from szs_web_item_content
where code='SZSWEB_DIVIDEND_INFORMATION'
and org_id=:org_id and sys_id=:sys_id
order by to_number(name) desc
沒有留言:
張貼留言