Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Bharathi09
Creator
Creator

matching data from two different tables

Hi All,

 

I have two different tables

Table1:

load

Code,

salary,

ID,

Name

From ();

 

Table2:

Code1,

DOJ,

DOL,

Age

From();

 

I want to see that data from Table2 'code1' matches with data from Table1 'code'

if matches it should give that matching data in another field as Code_data

if not matches it should give NA

Labels (1)
3 Replies
anat
Master
Master

sidhiq91
Specialist II
Specialist II

@Bharathi09 A simple left join can work as well.

Table1:

load

Code,

salary,

ID,

Name

From ();

left join (Table1)

Table2:

Code1 as  code,

DOJ,

DOL,

Age

From();

Noconcatenate:

Table3:

Load

if(isnull(Code),'N/A',Code) as Code,

salary,

ID,

Name,

DOJ,

DOL,

Age

Resident Table1;

Drop table Table1;

If this resolves your issue, please like ad accept it as a solution.

 

Bharathi09
Creator
Creator
Author

No it's not working

I need to check firstly the data from first table Code1 is matching with data from 2nd table Code2 if matches mark the matching data from code2 as in new field Code, otherwise N/A