日期:2014-05-16 浏览次数:20698 次
SQL> select * 2 from (with ord as (select 1 ID, 102 ORD_SOURCE 3 from dual 4 union all 5 select 2 ID, 103 ORD_SOURCE 6 from dual 7 union all 8 select 3 ID, 105 ORD_SOURCE from dual), mem as (select 1 ID, 9 '张三' NAME 10 from dual 11 union all 12 select 2 ID, 13 '李四' NAME 14 from dual 15 union all 16 select 3 ID, 17 '王五' NAME 18 from dual) 19 select ord.id, ord.ORD_SOURCE, mem.NAME 20 from ord, mem 21 where ord.ID = mem.ID) 22 where ORD_SOURCE = 102 23 or ORD_SOURCE = 103; ID ORD_SOURCE NAME ---------- ---------- ---- 1 102 张三 2 103 李四 SQL>
------解决方案--------------------
可以用 in(102, 103) 也可以用 or。
------解决方案--------------------
ORD_SOURCE = ‘102’ or ORD_SOURCE = ‘103’