Re: PostgreSQL in Comparison to mySQL - Mailing list pgsql-general

From Vince Vielhaber
Subject Re: PostgreSQL in Comparison to mySQL
Date
Msg-id Pine.BSF.4.30.0105150557010.5548-100000@paprika.michvhf.com
Whole thread Raw
In response to Re: PostgreSQL in Comparison to mySQL  (GH <grasshacker@over-yonder.net>)
List pgsql-general
On Mon, 14 May 2001, GH wrote:

> On Mon, May 14, 2001 at 02:07:03PM -0700, some SMTP stream spewed forth:
> > Hi,
> >
> *snip*
> > My questions revolve mostly among joined selects and auto_increment (serial
> > in pg) syntaxes.
> >
> > Can joined selects in pg be accomplished the same way as in mySQL?
> > ie- "select person_name, person_age from names, ages where names.id=4 and
> > names.id=ages.person_id"
>
> Yes.
> You can even do:
> select person_name, person_age from names n, ages a where n.id='4' and
> n.id=a.person_id
>
> BUT, you must single-quote attribute values, e.g. id, etc.

I was under the impression id was a serial and therefore an int.  You
don't need to quote and int:

asdf=# select person_name, person_age from names, ages where
names.personid=3 and names.personid=ages.personid;
 person_name | person_age
-------------+------------
 ralph       |         12
(1 row)


Vince.
--
==========================================================================
Vince Vielhaber -- KA8CSH    email: vev@michvhf.com    http://www.pop4.net
         56K Nationwide Dialup from $16.00/mo at Pop4 Networking
        Online Campground Directory    http://www.camping-usa.com
       Online Giftshop Superstore    http://www.cloudninegifts.com
==========================================================================




pgsql-general by date:

Previous
From: Lincoln Yeoh
Date:
Subject: index ops for _int4 and trees?
Next
From: Justin Clift
Date:
Subject: Re: Writing Result to Disk (psql)