Re: Subselect with no records results in final empty set

From: "Sterpu Victor" <victor(at)caido(dot)ro>
To: "John R Pierce" <pierce(at)hogranch(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Subselect with no records results in final empty set
Date: 2015-01-30 14:46:50
Message-ID: em1229821c-4842-4814-a4e6-203983f64359@victor-pc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I always have a single row in these selects so the result will have only
a row.
I must make a single select for a framework that takes as parameter a
single select to complete a XML template in a particular situation.

------ Original Message ------
From: "John R Pierce" <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)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's
>NOT a join condition, a join condition would be ON left_table.something
>= right_table.something
>
>>ON (1=1)
>
>equivalent to ON TRUE
>
>but that will cross join everything, so if the left table has N rows
>and the right table has M rows, you'll end up with N*M rows in the
>result. is that really what you want ??
>
>
>
>
>-- john r pierce 37N 122W
>somewhere on the middle of the left coast
>
>
>
>-- Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
>To make changes to your subscription:
>http://www.postgresql.org/mailpref/pgsql-general

---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Amiel 2015-01-30 15:30:31 Catalog Bloat
Previous Message Adrian Klaver 2015-01-30 14:46:06 Re: pgdump