SSRS 查询到 Oracle
SSRS query to Oracle
我的查询包含 SSRS 中的正确函数,但我需要在 Oracle 中使用相同的逻辑 SQL,我似乎无法找到解决方案来在 oracle 中找到与 RIGHT 使用相同的函数功能。
这是我的 SSRS 查询
case
when termnum = substring(dialnum,2,6) and len(dialnum) = '11' then` right(dialnum,10)
when termnum = right(dialnum,4) and len(dialnum) = '11' then right(dialnum,10)
when termnum = right(dialnum,4) and len(dialnum) = '10' then dialnum
when termnum = right(dialnum,5) and len(dialnum) = '11' the right(dialnum,10)
when termnum = right(dialnum,7) and len(dialnum) = '10' then dialnum
else null
end new_termnum
我需要将其更改为 Oracle。
谢谢你的帮助。
而不是使用 right(dialnum,10)
试试:substr(dialnum,-10)
希望对您有所帮助。
标记
https://sqlreports.wordpress.com/
我的查询包含 SSRS 中的正确函数,但我需要在 Oracle 中使用相同的逻辑 SQL,我似乎无法找到解决方案来在 oracle 中找到与 RIGHT 使用相同的函数功能。 这是我的 SSRS 查询
case
when termnum = substring(dialnum,2,6) and len(dialnum) = '11' then` right(dialnum,10)
when termnum = right(dialnum,4) and len(dialnum) = '11' then right(dialnum,10)
when termnum = right(dialnum,4) and len(dialnum) = '10' then dialnum
when termnum = right(dialnum,5) and len(dialnum) = '11' the right(dialnum,10)
when termnum = right(dialnum,7) and len(dialnum) = '10' then dialnum
else null
end new_termnum
我需要将其更改为 Oracle。 谢谢你的帮助。
而不是使用 right(dialnum,10) 试试:substr(dialnum,-10)
希望对您有所帮助。 标记 https://sqlreports.wordpress.com/