How to find records from table which are not present in the another table in MYSQL
Finding the data from Table A which are not present in table B.
For This we user WHERE NOT EXISTS.
- SELECT Column FROM Table 1 WHERE NOT EXISTS (SELECT COLUMN FROM TABLE 2 WHERE TABLE1.Column = TABLE2. Column )
Example :-
- SELECT *
- FROM student_master
- WHERE NOT EXISTS(SELECT * FROM student_choice WHERE student_master.student_scolar_no = student_choice.student_scholar_no )