多表查詢:
Select tableA.a,b,c
From tableA,tableB
Where tableA.a=tableB.a
當兩表有相同列名時,需在元素前加表名 tableA.a 。。。
單表內的模擬多表查詢:
Select first.a,second.a
From tableA first,tableA second
Where first.b = second.f
已實現2個表內聯接查詢,以下是查詢語句:
SELECT movIEs.mov_id AS 影片編號,
movies.mov_name AS 影片名稱,movIEs.mov_number AS 影片數量,
movies.mov_type AS 影片類型,movIEs.mov_new AS 推薦新片,
movIEs.mov_pupArea AS 影片出品地,
discs.disc_id AS 影碟編號,discs.disc_state AS 影碟狀態,
discs.disc_type AS 影碟類型,discs.disc_number AS 影碟數量,
movies.mov_brIEf AS 影片簡介,discs.disc_remark AS 備注
FROM movIEs INNER JOIN discs
ON movIEs.mov_id = discs.mov_id
select
a.corpid,
a.userid,
a.inid,
b.列
c.列
from a,b,c
where
a.corpid=b.corpid(+) and a.userid=b.userid(+)
and
a.corpid=c.corpid(+) and a.Inid=c.Inid(+);