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