Re: What is the best way to merge two disjoint tables?

Поиск
Список
Период
Сортировка
От Rodrigo De León
Тема Re: What is the best way to merge two disjoint tables?
Дата
Msg-id a55915760709071246x1d57a519i94f0090f088e4060@mail.gmail.com
обсуждение исходный текст
Ответ на Re: What is the best way to merge two disjoint tables?  (Chansup Byun <Chansup.Byun@Sun.COM>)
Список pgsql-general
On 9/7/07, Chansup Byun <Chansup.Byun@sun.com> wrote:
> One more question: Is there a way to make the  T2.U_ID + 1000  number to be incremental from a given number instead
ofadding 1000? 

See here:
http://archives.postgresql.org/pgsql-sql/2007-05/msg00194.php

Then, say we want to start from 49:

SELECT   COALESCE(T1.U_USER, T2.U_USER) AS U_USER
       , COALESCE(T1.U_ID
                , CASE
                    WHEN T2.U_ID IS NOT NULL
                      THEN 48 + ROWNUM()
                  END
                 ) AS U_ID
    FROM TABLEA T1 FULL JOIN TABLEB T2 ON T1.U_USER = T2.U_USER
ORDER BY U_ID

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

Предыдущее
От: Chansup Byun
Дата:
Сообщение: Re: What is the best way to merge two disjoint tables?
Следующее
От: "Collin Peters"
Дата:
Сообщение: Auto vacuum documentation