select a
from table a,table b
where a.id(+)=b.id
and a........这里该怎么写其中a的值包括 Y , N ,NULL三种
但我只想查出包括Y和N的值
只有Y或者只有N或者只有null的不显示1.null
2.Y
3.N
4.Y
N
我想的到第四种结果,是否可以做到
from table a,table b
where a.id(+)=b.id
and a........这里该怎么写其中a的值包括 Y , N ,NULL三种
但我只想查出包括Y和N的值
只有Y或者只有N或者只有null的不显示1.null
2.Y
3.N
4.Y
N
我想的到第四种结果,是否可以做到
解决方案 »
- ORA-12154: TNS: 无法解析指定的连接标识符 问题
- A Database develoter interview test
- 请高手帮忙,不会写啊
- sql中有没有测试字符串包含的查询子句
- oracle数据库启动问题!!是oracle专家表现的时候了!
- 如何向表中插入一个变量?
- 求救——哪里可以下载Oracle9i?
- oracle8i temp表空间已有5G被使用,oracle shutdown并重起后5G的空间未释放,怎么办呢?
- 安Oracle的过程中出现以下错误:ORA-12705:invalid or unknown NLS parameter value specified
- 一个有关数据统计的SQL语句
- 数据组合的超难问题。请高手指教~
- ORACLE技术问题
select a.pc,a.vat
from table a,table b
where a.id(+)=b.id
and a.vat .....
我只想得到a.vat即包含Y又包含N的值
楼上两位是否明白?
1.如果a.vat='N' 得PC110007 N
PC110008 N
2.如果a.vat='Y' 得PC110001 Y
PC110002 Y
3.如果a.vat=? 得 PC110005 N
PC110006 Y
怎么得到第三种情况?
from table_a a, table_b b
where a.id(+) = b.id
and exists (select 1
from table_a c
where c.id = a.id
and c.a_name = 'Y'
)
and exists (select 1
from table_a d
where d.id = a.id
and d.a_name = 'N'
)
from table a,table b
where a.id(+)=b.id
and a.xxx(+) = xxxx