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

Re: Two Tables That Share Data?

From: Carlos Mennens <carlos(dot)mennens(at)gmail(dot)com>
To: Michael Wood <esiotrot(at)gmail(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Two Tables That Share Data?
Date: 2012-02-09 16:34:28
Message-ID: (view raw or whole thread)
Lists: pgsql-novice
On Thu, Feb 9, 2012 at 11:28 AM, Michael Wood <esiotrot(at)gmail(dot)com> wrote:
> Try something like this:
> SELECT e.fname AS emp_fname, e.lname AS emp_lname, AS manager
> FROM employees AS e
> INNER JOIN managers AS m ON e.manager =
> WHERE e.salary = 12345.67;

I'm going to try this now but while I was working on this in pgAdmin3
query builder tool, I got the results I wanted which was to just query
my employee table and translate the employees.manager field from
INTEGER to their actual name referenced in '' as show

psql (9.1.2)
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
Type "help" for help.

zoo=# SELECT,
  employees.lname, AS manager
  employees.manager = AND employees.fname = 'Carlos';
 id | fname  |  lname  |    manager
  1 | Carlos | Mennens | Phill Collins
(1 row)

In response to


pgsql-novice by date

Next:From: Bartosz DmytrakDate: 2012-02-09 21:06:11
Subject: Re: Two Tables That Share Data?
Previous:From: Michael WoodDate: 2012-02-09 16:28:41
Subject: Re: Two Tables That Share Data?

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