Re: sql question (hopefully)

Поиск
Список
Период
Сортировка
От Ron Johnson
Тема Re: sql question (hopefully)
Дата
Msg-id 1055942345.32540.30.camel@haggis
обсуждение исходный текст
Ответ на sql question (hopefully)  ("Mel Jamero" <mel@gmanmi.tv>)
Ответы Re: sql question (hopefully)  ("Mel Jamero" <mel@gmanmi.tv>)
Список pgsql-novice
On Wed, 2003-06-18 at 07:38, Mel Jamero wrote:
> will try to keep this as short as possible. =)
>
> 1. "select id from a_table where id not in (2,3,4)" works fine
>
> 2. "select id from a_table where id not in (select id from b_table)" works
> fine if the output of the "select id from b_table" looks like:
> id
> ----
>  2
>  3
>  4
>
> problem is "select id from b_table" in #2 statement has the following
> output:
> id
> ----
> 2,3,4
>
> how do i do execute the query in a single sql statement?

b_table.id has Repeating Values, which breaks the 1st Normal Form
of relational DBMS design.

Thus, redesign b_table so that id only has 1 value.

--
+-----------------------------------------------------------+
| Ron Johnson, Jr.     Home: ron.l.johnson@cox.net          |
| Jefferson, LA  USA   http://members.cox.net/ron.l.johnson |
|                                                           |
| "Oh, great altar of passive entertainment, bestow upon me |
|  thy discordant images at such speed as to render linear  |
|  thought impossible" (Calvin, regarding TV)               |
+-----------------------------------------------------------


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

Предыдущее
От: "A.Bhuvaneswaran"
Дата:
Сообщение: Re: help:steps needed to get the content of table from the
Следующее
От: Dani Oderbolz
Дата:
Сообщение: Re: sql question (hopefully)