繁体   English   中英

在SQL中形成Case语句

[英]Forming Case statements in SQL

我需要为以下查询形成Case语句:

select 
Distinct T from iwa b 
where exists (
 select * from iwa where T=320 and art=1234
) 
and exists (
 select * from iwa where T=450 and art=1234 and art=b.art
);

select T from iwa where T=320 where art=1234;

Select T from iwa where T=450 where art=1234;

T是列名, iwa是表名, art是输入。 我应该从所有上述查询中获取输出。

我真的无法理解您要达到的目标。 也许您需要这样的东西?

select T 
from iwa 
where (T=320 and art=1234)
or (T=450 and art=1234)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM