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