select x from tablea where column=(select b from tableb where rownum=1)
SELECT a.x FROM tablea a, tableb b WHERE a.COLUMN = b.b
几种方法,效率各不同如2楼 select x from tablea where column in(select b from tableb);还可以用EXISTS,大部分情况比IN的效率高 select x from tablea a where exists (select 1 from tableb b where b.b=a.column );
1,select x from tablea where column=any(select b from tableb)2,select x from tablea where column in(select b from tableb);3,select x from tablea a where exists (select 1 from tableb b where b.b=a.column ); 这三种方法,习惯用第三种,不知道具体的执行效率是怎么样的,请高人指教。
FROM tablea a, tableb b
WHERE a.COLUMN = b.b
select x from tablea where column in(select b from tableb);还可以用EXISTS,大部分情况比IN的效率高
select x from tablea a where exists
(select 1 from tableb b
where b.b=a.column
);
(select 1 from tableb b
where b.b=a.column
);
这三种方法,习惯用第三种,不知道具体的执行效率是怎么样的,请高人指教。