just some more word :
> > In my opinion, these queries make the same :
> > SELECT id FROM article WHERE id=(SELECT MAX(id) FROM article);
> > SELECT MAX(id) FROM article;
> > but the latter one is much more simple and you do not overload your pg.
> > (by the way, I think id = (SELECT ...) isn't handled gracefully.)
> Hi, although I agreee with the first part: the subselect is redundat in
> this case, I don't understand de second one. The subselect will return one
> value, or am I wrong? So, I think the operator = will be correct, or not?
I mean the second sentence that I don't think the planner/optimizer is so clever to reduce the former query to the latter one.
You're right the sublselect will return one value, but as far as I know this value should be interpreted as a set of one value (because of the select).
In response to
pgsql-novice by date
|Next:||From: tompoe||Date: 2001-05-06 16:28:18|
|Subject: Did I fiddle too much with install?|
|Previous:||From: Jesus Aneiros||Date: 2001-05-05 12:28:36|
|Subject: Re: psql with PHP question|
pgsql-php by date
|Next:||From: Christian Marschalek||Date: 2001-05-05 15:40:47|
|Subject: RE: PHP calling PHP?|
|Previous:||From: Gyozo Papp||Date: 2001-05-05 13:32:56|
|Subject: Re: PHP calling PHP?|
pgsql-general by date
|Next:||From: Witold Rak||Date: 2001-05-05 13:58:24|
|Subject: How tnaslate kode from MySQL to Postgres?|
|Previous:||From: Christian Marschalek||Date: 2001-05-05 13:15:15|
|Subject: RE: [ADMIN] Primary Keys|