原生sql多表查詢
1.交叉連線(笛卡爾積)
select * from a, b
2.內連線
(1)隱式內連線
select * from a, b where b.aid = a.id
(2)顯示內連線
select * from a inner join b on b.aid = a.id
3.外鏈結
(1)左外連線
select * from a left [outer] join b on b.aid = a.id
(2)右外連線
select * from a right [outer] join b on b.aid = a.id
hql多表查詢
1.內連線(迫切)
from customer c inner join c.linkmans
from customer c inner join fetch c.linkmans
2.外鏈結
(1)左外連線(迫切)
from customer c left join fetch c.linkmans
(2)右外連線(迫切)
hibernate多表查詢
在沒有使用select的時候,返回的是乙個 student物件,否則返回的是乙個物件陣列 object ilist userlist session.find from testmssql.student as student where student.name 張三 nhibernate.nhi...
Oracle之多表查詢
多表查詢的基礎語法 select 查詢列 1 別名1,查詢列 2 別名2,from 表名稱1 別名1 名稱2 別名2 給出幾個例子吧。1.select e.ename,e.sal,d.dname,s.grade,m.ename,m.sal,ms.grade from emp e,dept d,sal...
MySql之多表查詢
select e.empname,d.deptname from emp e,dept d where e.deptno d.deptno select e.empname d.deptname from emp e inner join dept d on e.deptno d.deptno se...