100分求一个查询的写法。请大神看过来。谢谢!!!

888888888888 2013-07-05 09:01:15
在表中快速查出状态没有 Released 的记录。
例如 1100580 就是状态中没有 Released 的

编号 状态
----------------
1100580 Planned
1100580 Reserved
1100580 Partially Delivered
1100580 Partially Delivered
1100580 Delivered
1100580 Delivered
1100580 Partially Delivered
1100580 Partially Delivered
1100581 Partially Delivered
1100581 Invoiced/Closed
1100581 Delivered
1100581 Invoiced/Closed
1100581 Picked
1100581 Reserved
1100581 Partially Delivered
1100581 Released
...全文
281 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
888888888888 2013-07-05
  • 打赏
  • 举报
回复
谢谢,问题解决了。
u010412956 2013-07-05
  • 打赏
  • 举报
回复
select * from t t1 where not exists(select 1 from t t2 where t1.编号=t2.编号 and t2.状态='Released')
yifeng0329 2013-07-05
  • 打赏
  • 举报
回复
select distinct 编号 from tab_name where 编号 not in (select 编号 from tab_name where 状态='Released');
sych888 2013-07-05
  • 打赏
  • 举报
回复
select * from tab_name where 编号 not in (select 编号 from tab_name where 状态='Released');
888888888888 2013-07-05
  • 打赏
  • 举报
回复
不对,效果没出来。 我就要一个结果 1100580
  • 打赏
  • 举报
回复

select *
from tb1
where 状态 not like '%Released%'
  • 打赏
  • 举报
回复

select *
from tb1
where replace(状态,'Released','') = 状态

17,140

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧