I have to generate a query output for not matching records.
Assuming that i have two tables Table1 and Table2. Both Tables have the columns as DrugName. No Id column. Just the value column.
I have to generate an output from Table1 by filtering DrugNames which are in Table2. Assuming, Table1 has 1000 records and Table2 has 100 records. On applying filter, i should get 900 records from Table1.
select * from Table1 left join Table2 on Table1.DrugName = Table2.DrugName where Table2.DrugName is null
Above syntax returns non matching records.
Let's say in Table2.DrugName will be "ABCD" while in Table1.DrugName will be either "XYZ ABCD" or "ABCD GHIJ". If Table1.DrugName has matching word "%ABCD%", I have to filter.