Skip to content
Advertisement

SQL left join but only take the specific condition on a column

I have two tables, the first is a table that contains status and the second is contains balance. I want to join those two tables but with only specific status on the first table

Sample Data Table 1

Sample Data Table 2

Desired output

I tried to use:

It will return multiple balance which is not quite right

Advertisement

Answer

Looks like you want CASE

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement