PL/SQl问题,oracle 9i
我们这里有一个场景,如果下面的条件不成立,我们需要归还汽车,并且如果为真,则不返回任何内容(或 null),
table-> from car_list
condition where color = red and color_tinge = light and car = ?
现在可以有多个颜色值=红色和颜色色调=任何东西......我们只需要满足这两种情况的。 这是表的示例数据:
car color color_tinge a1 red light a2 red dark a1 green light a3 blue dark
如果条件不为真,则输出数据应为 car#(我们正在传递 条件的车号),如果条件为真,则为空或无
任何帮助,不胜感激!
We have a scenario here where we need to return the car if the below condition is not true and not return anything (or null)if its true
table-> from car_list
condition where color = red and color_tinge = light and car = ?
now there can be multiple values for color = red and color tinge = anything... and we need only the ones which satisfy both cases.
Here is sample data of the table:
car color color_tinge a1 red light a2 red dark a1 green light a3 blue dark
the output data should be car# if the condition is not true( we are passing
the car number to the condition) and null or nothing if the condition is true
any help is appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
选择汽车
来自汽车列表
在哪里
不是(颜色 = '红色' 且 color_tingle = '浅色')
和汽车 = car_id;
select car
from car_list
where
not (color = 'red' and color_tingle = 'light')
and car = car_id;
然后……
或者……
and then...
Or...
初始化...
然后...
Initialize...
Then...
这将返回
car#ID
或NULL
。不确定我是否正确理解你想要什么。这行得通吗?
This will return either
car#ID
orNULL
. Not sure if I understand correctly what you want.Would this work?