求一sql语句,大家帮帮忙 select distinct id from A where flag<>'X' 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select distinct id from A where NVL(flag,'')<>'X' select distinct id from A where NVL(flag,'')<>'X'似乎效率太低,因为id有3000多个,每个id对应的item有30多个 select distinct id from a where flag='x' and id not in(select id from a where flag<>'x' or flag is null) 看看这个! select distinct id from a where id not in(select id from a where flag<>'x' or flag is null) 这样也可以的,试试! 楼上的选择的是相反的记录吧.如果那样效率也不会很好.我也来写一个:select distinct id from (select id from a minus select id from a where flag='x')不知道行不行,没试.还是顶楼来的快. 试试俺的,哇哈哈~~~select id from a where flag<>'X' group by id select distinct id from A where id not in (select distinct id from A where nvl(flag,'#')<>'X' );用nvl函数呗~ 8好意思,上面写的那个反了,试试这个:select distinct id from A where nvl(flag,'#')<>'X' ; 菜鸟求oracle高手指教 oracle面试题求解 sql 中的(+) 在查询结果中增加自己定义的一行 交叉表问题 哪位大大帮忙解决下。 哪个哥们知道ORACLE9i 怎样在 IBM AIX V5.1 上安装吗?谢谢 oracle数据导入问题!在线等,谢谢! 初学者问题:如何将一用户的对象权限全部复制到另一用户中,或一个用户怎么样添加对象权限呢? 求职 关于凭证检索错误:) 单击安装Oracle9i oracle92中怪异问题
似乎效率太低,因为id有3000多个,每个id对应的item有30多个
我也来写一个:
select distinct id from (select id from a minus select id from a where flag='x')
不知道行不行,没试.还是顶楼来的快.
where id not in (select distinct id from A where nvl(flag,'#')<>'X' );用nvl函数呗~
select distinct id from A where nvl(flag,'#')<>'X' ;