View previous topic :: View next topic
|
Author |
Message |
delago
New User
Joined: 29 Jul 2005 Posts: 21 Location: Brazil
|
|
|
|
Hi guys,
I need some help.
I have a table:
table_1
colum01 CHAR
colum02 INTEGER
colum03 INTEGER
colum04 INTEGER
... <== have more 36 colums next
colum40 CHAR
I need to insert a new row in that table, with some data from another row. The row in the same table too.
I wrote the command, but I receive only message errors. My comand is:
insert into table_01
Values( 'g', 0001, 0001, (select colum04, colum05,....colum40
from table_01
where colum01 = 'x'
and colum02 = 0065
and colum03 = 1001000));
I need to set the 3 first colums and receive from SELECT the another colums.
Somebody know is possible?
Thank for some help. |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
Hello delago,
try this
Code: |
INSERT INTO TABLE_01
SELECT 'G',
0001,
0001,
COLUM04,
COLUM05,
:
:
COLUM40
FROM TABLE_01
WHERE COLUM01 = 'X'
AND COLUM02 = 0065
AND COLUM03 = 1001000
;
|
|
|
Back to top |
|
|
delago
New User
Joined: 29 Jul 2005 Posts: 21 Location: Brazil
|
|
|
|
Thank's Dave!
This resolved my problem.
Oh!...and HappyNew Year!
Good Job.
Fernando Delago - BR/SP |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
Glad we could help Fernando,
You have a good 2007 also.
Hope to see more posts from you |
|
Back to top |
|
|
|