Left join mysql - Mysql

How to use left join in mysql tables?

Snippet Code

Rate this page :
  [ 0 votes]

MySQL LEFT JOIN query returns all the rows in the left table, based on the matches found in the right table. When no matches are found, the result will be NULL in the right side.

Syntax: SELECT column_name(s) FROM table1 LEFT JOIN table2 ON table1.column_name=table2.column_name; Eg: SELECT T1.name,T2.regnum,T2.student_type FROM student AS T1 LEFT JOIN student_detail AS T2 ON T1.id=T2.id;


Ask Questions

Ask Question