Hi Andreas!
--- On Fri, 2/13/09, A. Kretschmer wrote:
> In response to Eus :
> > Hi Ho!
> >
> > Is there a way to check whether or not a subquery
> returns an empty result set?
>
> You can use EXISTS for that:
>
> -- empty result
> test=*# select * from (select 1 where 1=2) foo;
> ?column?
>
Hi Craig!
--- On Fri, 2/13/09, Craig Ringer wrote:
> Eus wrote:
> > Hi Ho!
> >
> > Is there a way to check whether or not a subquery
> returns an empty result set?
>
> "EXISTS"
>
> SELECT blah FROM blah WHERE EXISTS (SELECT 1 FROM tablename
> WHERE ...);
Thank you. Previously I tried: "... W
In response to Eus :
> Hi Ho!
>
> Is there a way to check whether or not a subquery returns an empty result set?
You can use EXISTS for that:
-- empty result
test=*# select * from (select 1 where 1=2) foo;
?column?
--
(0 rows)
-- check if a result exists
test=*# select exists(select *
Eus wrote:
> Hi Ho!
>
> Is there a way to check whether or not a subquery returns an empty result set?
"EXISTS"
SELECT blah FROM blah WHERE EXISTS (SELECT 1 FROM tablename WHERE ...);
> postgre check "empty result set"
It's not "postgre". It's PostgreSQL, or "postgres". This matters when
you'r
Hi Ho!
Is there a way to check whether or not a subquery returns an empty result set?
Googling with the following keywords does not help:
postgre check "empty result set"
sql check empty result
Thank you.
Best regards,
Eus (FSF member #4445)
In this digital era, where computing technology is