SELECT * FROM products a CROSS JOIN sales b WHERE b.p_id=2
p_id | product | price | sale_id | c_id | p_id | product | qty | store |
1 | Hard Disk | 80 | 4 | 4 | 2 | RAM | 2 | DEF |
1 | Hard Disk | 80 | 7 | 2 | 2 | RAM | 3 | ABC |
1 | Hard Disk | 80 | 8 | 3 | 2 | RAM | 2 | DEF |
2 | RAM | 90 | 4 | 4 | 2 | RAM | 2 | DEF |
2 | RAM | 90 | 7 | 2 | 2 | RAM | 3 | ABC |
2 | RAM | 90 | 8 | 3 | 2 | RAM | 2 | DEF |
3 | Monitor | 75 | 4 | 4 | 2 | RAM | 2 | DEF |
3 | Monitor | 75 | 7 | 2 | 2 | RAM | 3 | ABC |
3 | Monitor | 75 | 8 | 3 | 2 | RAM | 2 | DEF |
4 | CPU | 55 | 4 | 4 | 2 | RAM | 2 | DEF |
4 | CPU | 55 | 7 | 2 | 2 | RAM | 3 | ABC |
4 | CPU | 55 | 8 | 3 | 2 | RAM | 2 | DEF |
5 | Keyboard | 20 | 4 | 4 | 2 | RAM | 2 | DEF |
5 | Keyboard | 20 | 7 | 2 | 2 | RAM | 3 | ABC |
5 | Keyboard | 20 | 8 | 3 | 2 | RAM | 2 | DEF |
6 | Mouse | 10 | 4 | 4 | 2 | RAM | 2 | DEF |
6 | Mouse | 10 | 7 | 2 | 2 | RAM | 3 | ABC |
6 | Mouse | 10 | 8 | 3 | 2 | RAM | 2 | DEF |
7 | Motherboard | 50 | 4 | 4 | 2 | RAM | 2 | DEF |
7 | Motherboard | 50 | 7 | 2 | 2 | RAM | 3 | ABC |
7 | Motherboard | 50 | 8 | 3 | 2 | RAM | 2 | DEF |
8 | Power supply | 20 | 4 | 4 | 2 | RAM | 2 | DEF |
8 | Power supply | 20 | 7 | 2 | 2 | RAM | 3 | ABC |
8 | Power supply | 20 | 8 | 3 | 2 | RAM | 2 | DEF |
←CROSS JOIN
LEFT JOIN using Multiple Tables →
← Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
plus2net.com