Skip to content
Advertisement

Tag: left-join

SQL If Not Any From Left Join Else Left Join

I the following query and I only want the results from the first left join that returns results for the addresses (add1/2/3). Is it possible, or should I just return it all and filer the results later? For example, if add1 returns 1 address, add2 returns 1 address and add3 returns 3 addresses, I only want the result set from

Postgres Left Join with where condition

I need to left join two tables with a where condition: time_table record_table I need to get all those records which are present under given date range. In the above example, I need those records that lie under range for rid = 2 only. Hence the output for the above query needs to be: Answer left join two tables with

Advertisement