I have two tables X1 and Y1, the table X contains a records as shown in the below
X1 table data
ID NAME MIDDLE LAST CRTN_DTE UPDTE_DTE
12345 JOHN JOHN JOHN 2016-10-15 2016-10-20
Y1 table data
ID STATUS FK_ID CRTN_DTE UPDTE_DTE
603356 2 12345 2016-10-20 2016-10-20
603356 4 12345 2016-10-16 2016-10-18
The common colums are X1 Table ID attribute and y1 table , FK_ID attribute.
What I want here is when status is '2' then X1 data should not come and when it is '4' then X1 data should come .
Many Thanks In advance
CODE' D and ALIGNED
To make things more readable for the people who will spend their time trying to help You