1

my problem is when i going to join two table altogather i ran into the problem with one table has data another table has no data but i want to display if data has one table it should display with another table blank . below query i tired but it is getting blank.

SELECT seats.busno, seats.seats, busbook.customer,busbook.mobile,seats.date 
FROM seats 
INNER JOIN busbook ON seats.busno=busbook.busno
ScaisEdge
  • 131,976
  • 10
  • 91
  • 107
deva ram
  • 65
  • 8
  • Does this answer your question? [What's the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN and FULL JOIN?](https://stackoverflow.com/questions/5706437/whats-the-difference-between-inner-join-left-join-right-join-and-full-join) – Alberto Moro Dec 06 '19 at 08:24

2 Answers2

0

if you want also not matching values you should use left join

SELECT seats.busno, seats.seats, busbook.customer,busbook.mobile,seats.date 
FROM seats 
LEFT JOIN busbook ON seats.busno=busbook.busno
ScaisEdge
  • 131,976
  • 10
  • 91
  • 107
0

INNER join work only when at least 1 match between the tables.

Ajeet Verma
  • 1,021
  • 1
  • 7
  • 25