INNER JOIN
- দুইটা টেবলের মধ্যে একটা কমন ভেলু থাকলেই কেবল দুই টেবিল থেকে ডাটা রিটার্ন করবে
- অনেকটা দুইটা টেবিলে ডাটার মধ্যে AND কন্ডিশন দেয়ার মতো
সিনটেক্সট
SELECT * FROM TableA INNER JOIN TableB ON TableA.employee = TableB.employee
এলিয়াস সহকারে
SELECT employee FROM TableA A INNER JOIN TableB B ON A.employee = B.employee
e_id | Surname | First name | d_id |
---|---|---|---|
1 | Schmidt | Jack | 3 |
2 | Muller | Blain | 1 |
3 | McClain | Walker | 1 |
4 | Cohn | Greg | 2 |
5 | Connolly | Kevin | NULL |
d_id | Designation | Location |
---|---|---|
1 | Sales | Denver |
2 | IT | Syracurse |
3 | Personal | Portland |
4 | Research | Louisville |
SELECT * FROM employee INNER JOIN departments ON employee.d_id = departments.d_id;
e_id | Surname | First name | employee.d_id | department.d_id | Designation | Location |
---|---|---|---|---|---|---|
1 | Schmidt | Jack | 3 | 3 | Personal | Portland |
2 | Muller | Blain | 1 | 1 | Sales | Denver |
3 | McClain | Walker | 1 | 1 | Sales | Denver |
4 | Cohn | Greg | 2 | 2 | IT | Syracuse |