How to select a new column based on values of two column from two tables with null if no data is present.
I have two tables
table1 with column1 and table2 with column2. I need to select data from both these columns in column3 (column3 would be a part of table1) in a way that:
column1 column2 column3
------- ------- -------
1 2 null
2 3 present
3 present
4 null
If the value of column2 is present in column1
=> I need to be able to assign a string(lets say "present") in column3
else the value in column3 should be null
At present I am using join but I wasnt able to assign the null part to column3
Thanks in advance.