GuestID | Name |
1001 | Nick |
1002 | Jack |
1003 | Apple |
Product | GuestID |
Table | 1002 |
Chair | 1003 |
Almari | 1002 |
Table B
SQL inner join
Example for SQL inner join
- Join more than 1 table to get other table data
1. SELECT A.Name, B.Product FROM A INNER JOIN B ON A.GuestID=B.GuestID
Result :
Name | Product |
Jack | Table |
Apple | Chair |
Jack | Almari |
2. SELECT A.Name, B.Product FROM A INNER JOIN B ON A.GuestID=B.GuestID WHERE B.Product = 'tABLE'
Result:
Name | Product |
Jack | Table |