Shivakumar

Shivakumar

  • NA
  • 103
  • 7.5k

how can I join the result of these two queries based on lid

Jul 1 2021 11:11 AM

Hello everyone. I have many tables in my database out of which I have made two queries on some of the tables
Results of the two queries are like:

1st query                 

lid   mref  tearned
1     2      5
2     4      0
3     9      3 
4     5      8
5     6      0

2nd query

lid  amount
2    5
3    4

But I want the resultant of these two queries to be like below 

lid   mref  tearned   amount
1    2        5              0
2    4        0              5
3    9        3              4
4    5        8              0
5    6        0              0

can someone please help me? how can I join the result of these two queries based on lid.


Answers (2)