當我們要找出 A TABLE 的DATA 存在於 B TABLE 的資料 時
當A TABLE的KEY 只有 一個時通常都會
select * form A where APKColumn in (select APKColumn from B )
 
但是如果 A TABLE 的KEY 有兩個的時候就很難用上面的語法來找出來
這時候 EXISTS 就派上用場
 
select * from A
where exists (select * from B where B.APKColumn1 =A.APKColumn1 AND B.APKColumn2 =A.APKColumn2 )
 
 
arrow
arrow
    全站熱搜

    丫烈客 發表在 痞客邦 留言(1) 人氣()