| От | Michael Avila |
|---|---|
| Тема | SQL Statement Help needed |
| Дата | |
| Msg-id | NBBBLNPHAMCFENDFHIDCEEGHEGAA.Michael.Avila.1@sbcglobal.net обсуждение исходный текст |
| Ответы |
Re: SQL Statement Help needed
|
| Список | pgsql-sql |
I am not much of a SQL guru so I am having trouble trying to figure out how to format a SQL statement. I have a table with members named members. Each member has only 1 record. Then I have a table with member telephone numbers in it name membertelephones. 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 or something or do I need to get the members and then loop through the membertelephones to get the telephone numbers? Is it possible to do a JOIN with a table with one record with a table with multiple records? SELECT * FROM member SELECT * FROM membertelephone WHERE member_id = the id from the above SELECT Thanks for the help. Mike
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера