Re: SQL Statement Help Needed

Поиск
Список
Период
Сортировка
От Frank Bax
Тема Re: SQL Statement Help Needed
Дата
Msg-id 5.2.1.1.0.20051204093529.00a3d470@pop6.sympatico.ca
обсуждение исходный текст
Ответ на SQL Statement Help Needed  ("Michael Avila" <Michael.Avila.1@sbcglobal.net>)
Ответы Re: SQL Statement Help Needed  (<operationsengineer1@yahoo.com>)
Список pgsql-novice
At 04:12 AM 12/4/05, Michael Avila wrote:
>I have a table with members named members. Each member has only 1 record.
>A member can have more than one telephone number (home,
>work, cell, pager, fax, etc.). I want to print out the telephone numbers of
>the members. Is it possible to do it in one SQL statement like with a JOIN

Yes.

>do I need to get the members and then loop through the
>membertelephones to get the telephone numbers?

No.

>Is it possible to do a JOIN
>with a table with one record with a table with multiple records?

Yes.


>SELECT * FROM member
>
>SELECT * FROM membertelephone WHERE member_id = the id from the above SELECT

         http://en.wikipedia.org/wiki/Join_%28SQL%29


В списке pgsql-novice по дате отправления:

Предыдущее
От: Marcus Engene
Дата:
Сообщение: Re: What is the Best Way to Learn PL/pgSQL?
Следующее
От: brew@theMode.com
Дата:
Сообщение: Re: SQL Statement Help Needed