Re: Select statement

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Select statement
Дата
Msg-id 009501c0e29c$280d26e0$1001a8c0@archonet.com
обсуждение исходный текст
Ответ на Select statement  (dave go <godave621@yahoo.com>)
Список pgsql-general
From: "dave go" <godave621@yahoo.com>

> Hi,
>
> I am trying create a new table A from table B. On B
> (b1, b2, b3, b4 ) I would like create a table A (a1,
> a2, a3) where a2 is b2 and b3.

create table foo(a serial, b text);

select a, substr(b,1,strpos(b,' ')-1) as firstname, substr(b,strpos(b,'
')+1) as lastname into bar from foo;

will create a table bar. You will need to add your own sequences etc. later.

Note - CHECK YOUR NAMES FIRST - this will only work with exactly two names
separated by one space.

- Richard Huxton


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

Предыдущее
От: Dirk Lutzebaeck
Дата:
Сообщение: Load balancing lots of simultaneous clients or queries?
Следующее
От: Ludovico Romano
Дата:
Сообщение: how to convert Access to PG unless odbc driver(with sql file)