一个有点复制的SQL语句

realjoshzuo 2013-03-14 12:08:39

tb1: style ,type

tb2: style ,type ,qty

如何判断 style为A,type 为 7,8,9 是否在tb2中同时存在qty>0
...全文
141 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
music_mouse 2013-03-14
  • 打赏
  • 举报
回复
题目的意思是不是:数据要来自tb1,但要满足tb2的条件。。看看正面的SQL: select a.style,a.type from tb1 a left join tb2 b on a.style=b.style and a.type = b.type where a.style='A' and a.type in(7,8,9) and b.qty>0;
zhumingxu1984 2013-03-14
  • 打赏
  • 举报
回复
不大懂意思 select * from tb2 where style='A' and type in (7,8,9) and qty > 0

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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