No we can say like this
I have a two table
Table 1 | | | |
| | | |
Patient ID | Service Request Type | SR Created Date | CaseNumber |
PAT-188149 | GATCF Patient Assistance | 4/19/2016 | 435031 |
PAT-188149 | GATCF Patient Assistance | 4/9/2018 | 1125219 |
PAT-188149 | Patient Foundation | 12/8/2018 | 1634660 |
PAT-188149 | Patient Foundation | 6/25/2019 | 2151894 |
Table 2 | | | |
| | | |
BI Patient ID | BI Service Request Type | BI SR Created Date | BI CaseNumber |
PAT-188149 | Benefits Investigation/Prior Authorization | 4/4/2018 | 1118864 |
PAT-188149 | Benefits Investigation/Prior Authorization | 6/4/2018 | 1118865 |
PAT-188149 | Benefits Investigation/Prior Authorization | 4/6/2019 | 18197 |
Now we need to check some condition like
we need to bring all BI record into the table with this condition my BI SR Created date is less then SR Created date Below is the out put
Patient ID | Service Request Type | SR Created Date | CaseNumber | BI Service Request Type | BI SR Created Date | BI CaseNumber |
PAT-188149 | GATCF Patient Assistance | 4/19/2016 | 435031 | | | |
PAT-188149 | GATCF Patient Assistance | 4/9/2018 | 1125219 | Benefits Investigation/Prior Authorization | 4/4/2018 | 1118864 |
PAT-188149 | Patient Foundation | 12/8/2018 | 1634660 | Benefits Investigation/Prior Authorization | 6/4/2018 | 1118865 |
PAT-188149 | Patient Foundation | 6/25/2019 | 2151894 | Benefits Investigation/Prior Authorization | 4/6/2019 | 18197 |