Re: psql with PHP question

From: Jesus Aneiros <aneiros(at)ucfinfo(dot)ucf(dot)edu(dot)cu>
To: Gyozo Papp <pgerzson(at)freestart(dot)hu>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: psql with PHP question
Date: 2001-05-05 12:28:36
Message-ID: Pine.LNX.4.10.10105050824290.16295-100000@ucfinfo.ucf.edu.cu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice pgsql-php

On Thu, 3 May 2001, Gyozo Papp wrote:

> 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?

Saludos, jesus.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gyozo Papp 2001-05-05 12:33:22 Re: arbitrary number of values from a sequence
Previous Message Eric G. Miller 2001-05-05 11:17:21 Re: how can i change my table/column constraint

Browse pgsql-novice by date

  From Date Subject
Next Message Gyozo Papp 2001-05-05 13:45:51 Re: psql with PHP question
Previous Message Tom Lane 2001-05-04 23:20:26 Re: Converting a proceedure from SOLID to Postgres

Browse pgsql-php by date

  From Date Subject
Next Message Christian Marschalek 2001-05-05 12:51:07 PHP calling PHP?
Previous Message Joel Burton 2001-05-04 20:15:21 Re: [PHP] psql with PHP question