
oracle怎么用查询结果当作where条件?
在oracle中casewhen只能用在结果中,要达到下面语句的效果,需要怎么写语句?select*fromt_webwherecasef2when'all'thenor...
在oracle中case when 只能用在结果中,要达到下面语句的效果,需要怎么写语句?
select * from t_web where
case f2
when 'all' then orgid in ('1000','2000','3000','1')
when 'part' then f4 like '%7275765e731549f0bfa24c83151d4134%'
when 'owner' then orgid='1' end
order by sortid,topid asc,releasetime desc
是要达到这种效果:
当查询出f2的值是all的时候,查询条件是orgid in ('1000','2000','3000','1'),
当查询出f2的值是part的时候,查询条件是of4 like '%7275765e731549f0b%',
当查询出f2的值是owner的时候,查询条件是orgid='1'。 展开
select * from t_web where
case f2
when 'all' then orgid in ('1000','2000','3000','1')
when 'part' then f4 like '%7275765e731549f0bfa24c83151d4134%'
when 'owner' then orgid='1' end
order by sortid,topid asc,releasetime desc
是要达到这种效果:
当查询出f2的值是all的时候,查询条件是orgid in ('1000','2000','3000','1'),
当查询出f2的值是part的时候,查询条件是of4 like '%7275765e731549f0b%',
当查询出f2的值是owner的时候,查询条件是orgid='1'。 展开
1个回答
2017-08-28
展开全部
oracle怎么用查询结果当作where条件?
1. exists
where exists (select 1 from abc where xxx)
2. in
where xxx in (select xxx from abc where ...)
3. = (只能返回一行)
where xxx = (select xxx from abc where ...)
当然,子查询中是可以使用外部的表。

2025-03-12 广告
以下是虚拟筛选的简要流程图说明:1. **调研靶点**:确认是否有参考药物与结合模式信息。2. **建立模型**:基于靶点蛋白结构,参考已有药物结合信息或预测药物结合模式。3. **选择库源**:从多样性化合物库、上市药物分子库等中挑选合适...
点击进入详情页
本回答由MCE 中国提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询