Skip site navigation (1) Skip section navigation (2)

Re: Select problem

From: "Karl F(dot) Larsen" <k5di(at)zianet(dot)com>
To: Joe LaLumiere <joelight(at)tiac(dot)net>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Select problem
Date: 2000-08-14 17:23:12
Message-ID: Pine.LNX.4.10.10008141120200.1275-100000@cannac.ampr.org (view raw or flat)
Thread:
Lists: pgsql-novice
	You are exactly right Joe. Thanks and I found another way which
sometimes works. It goes

	select data.* , user
	from......

when you want all from table "data" and user from another. 


On Mon, 14 Aug 2000, Joe LaLumiere wrote:

> >but if I want to get the column armycall and use:
> >
> >	select user, armycall
> >	from data, biglist
> >	where user.armycall = biglist.armycall
> >
> >I get an error that armycall is ambiguous.
> >
> >	Does anyone know how to correct this?
> 
> Since you have two tables which have the same field name you need to specify which table to grab the field from.  The corrected select statement would be:
> 
> 	select user, user.armycall
> 	from data, biglist
> 	where user.armycall = biglist.armycall
> 
> OR
> 
> 	select user, biglist.armycall
> 	from data, biglist
> 	where user.armycall = biglist.armycall
> 
> Either of these two will work.  The above applies to any two fields which have the same name in two or more tables.
> 
> Joe LaLumiere
> 
> >
> >Yours Truly,
> >
> >  	 - Karl F. Larsen, k5di(at)arrl(dot)net  (505) 524-3303  -
> >
> >
> >
> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
>  \   Joseph LaJeunesse-LaLumiere  /  Phone: (781) 276-6816     \  TIAC - The Internet Access Company  /
>   \  Systems Administrator I     /   Pager: (617) 473-2573      \      - A Division of Inter.net     /
>    \ Inter.net - Bedford MA     /    Email: joelight(at)tiac(dot)net    \                                  /
>     ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> 
> 

Yours Truly,

  	 - Karl F. Larsen, k5di(at)arrl(dot)net  (505) 524-3303  -


pgsql-novice by date

Next:From: Eduardo KotujanskyDate: 2000-08-14 18:35:56
Subject: kdevelop -> libpq-fe.h
Previous:From: John McKownDate: 2000-08-14 16:35:29
Subject: Re: Select problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group