如何在teradata中转换按级别连接
我试图将oracle的connect by level功能转换为teradata。我在网上看到了很多例子,但这个特定的例子不同,
(SELECT
CASE LEVEL
WHEN 1 THEN 'MB'
WHEN 2 THEN 'SB'
ELSE 'TOTAL'
END AS DRUG_SOURCE
FROM
DUAL
CONNECT BY LEVEL <= 3) RW
如果你们有任何想法,请告诉我。
I was trying to convert the connect by level function of oracle to teradata. I have seen many examples over the net but this particular one is different,
(SELECT
CASE LEVEL
WHEN 1 THEN 'MB'
WHEN 2 THEN 'SB'
ELSE 'TOTAL'
END AS DRUG_SOURCE
FROM
DUAL
CONNECT BY LEVEL <= 3) RW
Please let me know if you guys have any idea.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
嘿,我找到了解决方案。抱歉,我无法清楚地解释我的问题。
下面的代码将完全按照我在 Teradata 中想要的方式工作
Hey I found the solution for this. Sorry I couldn't explain my question clearly.
The below code would work exactly the way i wanted in teradata
你可以试试这个代码:
You can try this code: