Subselect with no records results in final empty set - Mailing list pgsql-general

From Sterpu Victor
Subject Subselect with no records results in final empty set
Date
Msg-id emc7bb6066-5c47-4c1b-bb14-6368b21499f7@victor-pc
Whole thread Raw
Responses Re: Subselect with no records results in final empty set  (David G Johnston <david.g.johnston@gmail.com>)
List pgsql-general
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 * FROM atc WHERE id = '1231222' LIMIT 1 OFFSET 0) AS s3;
 
Thank you.



This email has been checked for viruses by Avast antivirus software.
www.avast.com



DISCLAIMER:
Acest mesaj de posta electronica si documentele aferente sunt confidentiale. Este interzisa distribuirea, dezvaluirea sau orice alt mod de utilizare a lor. Daca nu sunteti destinatarul acestui mesaj, este interzis sa actionati in baza acestor informatii. Citirea, copierea, distribuirea, dezvaluirea sau utilizarea in alt mod a informatiei continute in acest mesaj constituie o incalcare a legii. Daca ati primit mesajul din greseala, va rugam sa il distrugeti, anuntand expeditorul de eroarea comisa. Intrucat nu poate fi garantat faptul ca posta electronica este un mod sigur si lipsit de erori de transmitere a informatiilor, este responsabilitatea dvs. sa va asigurati ca mesajul (inclusiv documentele alaturate lui) este validat si autorizat spre a fi utilizat in mediul dvs.

pgsql-general by date:

Previous
From: Bill Moran
Date:
Subject: Re: 4B row limit for CLOB tables
Next
From: "Sterpu Victor"
Date:
Subject: Re: Can I unite 2 selects?