ฉันมีตารางสามชื่อ
**Student Table**
-------------
id    name
-------------
1     ali
2     ahmed
3     john
4     king
**Course Table**
-------------
id    name
-------------
1     physic
2     maths
3     computer
4     chemistry
**Bridge**
-------------
sid    cid
-------------
1     1
1     2
1     3
1     4
2     1
2     2
3     3
3     4
4     1
4     2
ตอนนี้เพื่อแสดงชื่อนักเรียนพร้อมชื่อหลักสูตรที่เขาเคยเรียนเช่น
**Result**
---------------------------
Student        Course
---------------------------
ahmed         physic
ahmed         maths
ahmed         computer
ahmed         chemistry
ali           physic
ali           maths
john          computer
john          chemistry
king          physic
king          maths
ฉันสร้างแบบสอบถามต่อไปนี้
select s.name as Student, c.name as Course from student s, course c join bridge b on c.id = b.cid order by s.name
แต่กลับไม่ได้ผลลัพธ์ที่ต้องการ ...
และจะเป็นอย่างไรสำหรับรูปแบบมาตรฐานถ้าฉันต้องการค้นหาว่าใครเป็นผู้จัดการมากกว่าคนอื่น ๆ :
**employee**
-------------------
id        name
-------------------
1         ali
2         king
3         mak
4         sam
5         jon
**manage**
--------------
mid      eid
--------------
1         2
1         3
3         4
4         5
และต้องการรับผลลัพธ์นี้:
**result**
--------------------
Manager      Staff
--------------------
ali          king
ali          mak
mak          sam
sam          jon