Skip to Content
0
Former Member
Nov 22, 2012 at 07:47 AM

Query

15 Views

Hi

I have written this query

SELECT a.Code, a.Name , b.U_Amount as Amount FROM [@TEMP]a left JOIN [@TEMP1]b ON a.Code = b.U_Al_Code left join ohem c on c.empid = 1

There are 4 records in Table 1 & 2 records in Table 2 of ID 1 . I want all the 4 records to be displayed and value in Amount in only 2 records as there are only 2 records with amount value of ID 1.

Above query is showing all 4 records from Table 1 and Amount Value also in 4 records but there are only 2 records in second table.

Thanks