Multiple table selection. - Mailing list pgsql-sql

From Colin Dick
Subject Multiple table selection.
Date
Msg-id Pine.LNX.3.96.980805082711.17202B-100000@ocis.ocis.net
Whole thread Raw
In response to cursor results count  (Sergei Barbarash <sgt@israel.ru>)
List pgsql-sql
Hi,
    I am new to the more complex SQL statements and I am having
trouble creating the statement I need.

    I have two tables:

table a            table b
-------                 -------
idnum (unique)        idnum (unique)
firstname        phone
lastname        fax


I want to be able to search the table for any value (sometimes multiple
values) and bring back all the information for all tables with the same
idnum. Would a query similar to the following do it.

select a.idnum, a.firstname, a.lastname, b.phone from a, b where
a.firstname='bob' and b.fax='123-4567' and (a.idnum=b.idnum);

Does that statement make sense?  Or can someone make a suggestion to help
me acclomplish the task.  Thadvanceanks...

--
Colin Dick
On Call Internet Services
cdick@mail.ocis.net



pgsql-sql by date:

Previous
From: Sergei Barbarash
Date:
Subject: cursor results count
Next
From: James Olin Oden
Date:
Subject: Re: [SQL] How do I get the list of table names in db