Re: Combine query views into one SQL string

Поиск
Список
Период
Сортировка
От Nils Zonneveld
Тема Re: Combine query views into one SQL string
Дата
Msg-id 3B9880EB.2B3294E9@mbit.nl
обсуждение исходный текст
Список pgsql-sql

Maik wrote:
> 
> With "Union" you can create one view.
> Ciao Maik

UNION wouldn't have the desired effect:

the result of a UNION SELECT would look like this:

ID AMOUNT
1  (table1.amount)
2  (table1.amount)
.   .
.   .
1  (table2.amount)
2  (table2.amount)

What he wants is:

ID TABLE1.AMOUNT TABLE2.AMOUNT
1  (amount)      (amount)
2  (amount)      (amount)
.  .             .
.  .             .
You can achieve that result with an inner join (and even MySQL with it's
rather restricted SQL subset supports an inner join).

Nils 
-- 
Alles van waarde is weerloos
Lucebert


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

Предыдущее
От: yaubi@yaubi.com (Yoann)
Дата:
Сообщение: Number the lines
Следующее
От: "Advid@newgen"
Дата:
Сообщение: Urgent: How to set autocommit off in postgres.........