Re: [GENERAL] Subselect with no records results in final empty set

2015-01-30 Thread Sterpu Victor
ql-general@postgresql.org Sent: 1/29/2015 10:52:25 PM Subject: Re: [GENERAL] Subselect with no records results in final empty set On 1/29/2015 12:36 PM, Sterpu Victor wrote: ON(null) never matched. NULL is neither true nor false. ON somefieldinthejoin IS NULL would be a valid syntax. except, that&#x

Re: [GENERAL] Subselect with no records results in final empty set

2015-01-29 Thread John R Pierce
On 1/29/2015 12:36 PM, Sterpu Victor wrote: ON(null) never matched. NULL is neither true nor false. ON somefieldinthejoin IS NULLwould be a valid syntax. except, that's NOT a join condition, a join condition would be ON left_table.something = right_table.something ON (1=1) equiv

Re: [GENERAL] Subselect with no records results in final empty set

2015-01-29 Thread David Johnston
On Thu, Jan 29, 2015 at 1:22 PM, Sterpu Victor wrote: > It works as you sugested, this is the syntax I used: > SELECT * FROM > (SELECT 1 AS t1, 2 AS t2) AS t1 > LEFT JOIN (SELECT * FROM atc WHERE id = '1231222') AS t2 ON (null) > > Thank you. > > You will notice that everyone responding to you is

Re: [GENERAL] Subselect with no records results in final empty set

2015-01-29 Thread Sterpu Victor
esql.org Sent: 1/29/2015 10:22:28 PM Subject: Re: [GENERAL] Subselect with no records results in final empty set It works as you sugested, this is the syntax I used: SELECT * FROM (SELECT 1 AS t1, 2 AS t2) AS t1 LEFT JOIN (SELECT * FROM atc WHERE id = '1231222') AS t2 ON (null) Thank y

Re: [GENERAL] Subselect with no records results in final empty set

2015-01-29 Thread Sterpu Victor
/29/2015 10:03:38 PM Subject: Re: [GENERAL] Subselect with no records results in final empty set Sterpu Victor wrote Hello I have this select where the last subselect will return a empty set and because of this the whole select will be empty. How can I change this syntax so I will have a ro

Re: [GENERAL] Subselect with no records results in final empty set

2015-01-29 Thread David G Johnston
Sterpu Victor wrote > Hello > > I have this select where the last subselect will return a empty set and > because of this the whole select will be empty. > How can I change this syntax so I will have a row result even if the > last select is empty? > > SELECT * FROM (SELECT 1 AS t1, 2 AS t2) as t

[GENERAL] Subselect with no records results in final empty set

2015-01-29 Thread Sterpu Victor
Hello I have this select where the last subselect will return a empty set and because of this the whole select will be empty. How can I change this syntax so I will have a row result even if the last select is empty? SELECT * FROM (SELECT 1 AS t1, 2 AS t2) as t, (SELECT 3 AS t3) as s, (SELECT *