I am having 2 tables named table1, table2. table1 columns are t1_id, t1_name, t1_status. table2 columns are t1_id, t2_id, t2_name, t2_status. When I do Some operation in frontend t1_id will be inserted into table2. What I need is I want t1_id(s) from table1 which are not alloted or inserted in table2.
I've tried this query:
SELECT t1.t1_id, t1.t1_name
FROM table1 t1
LEFT OUTER JOIN table2 t2
ON t1.t1_id != t2.t1_id
The problem with query is when all t1_id(s) are inserted into table2, then all t1_id(s) are showing again. How to resolve this issue? (I'am new to sql so please don't consider my mistakes.)