如何将列值设置为Oracle中的选择查询中的null?
我想选择一个等于特定页面项目值的列值,然后选择其他值作为null。 主表数据如下:
id | first_numbers | second_numbers |
---|---|---|
1 | 1112 | 2222 |
1 | 3434 | 1112 |
first_numbers = 1112的值等于:p4_number = 1112页面项目,所以我想要的预期结果是:
id | first first_numbers | second_numbers second_numbers |
---|---|---|
1 | 1112 | null |
1 null 1 | null 11112 null | 11112 |
I want to select a column value which is equal to a specific page item value and select the other values as null.
The main table data is the following:
id | first_numbers | second_numbers |
---|---|---|
1 | 1112 | 2222 |
1 | 3434 | 1112 |
The value of first_numbers=1112 is equal to :p4_number=1112 page item so the expected result which I want is:
id | first_numbers | second_numbers |
---|---|---|
1 | 1112 | null |
1 | null | 1112 |
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
案例
表达式:示例数据:
查询本身:
当您使用Apex时,您将使用bind(而不是替换)变量,即
Use
CASE
expression:Sample data:
Query itself:
As you use Apex, you'd use bind (instead of substitution) variable, i.e.