i have three tables file, expense and payment. I want fetch data from 3 table based on foreign key.
I have following three table
File Table
FileId
FileNo
Payment Table
Id
Amount
FK_FileID
Expense Table
Id
Amount
FK_FileID
I want output like
FileNo Amount IsPayment
10001 220 True
10001 120 False
10001 150 True
IsPayment is logical field if amount is from payment table IsPayment should be true and if it is from expense table it should be false.
I guess this query should do the trick: