View previous topic :: View next topic |
Author |
Message |
edkir98 Beginner

Joined: 27 Aug 2007 Posts: 102 Topics: 42 Location: Chennai
|
Posted: Mon Sep 22, 2008 2:16 am Post subject: Insert Into... Select |
|
|
Is it possible to use INSERT INTO statement with SELECT for only some rows..like.. I want to insert only the first 100 rows from the select statement..
for ex. a statement like this
Code: | INSERT INTO <table name>
SELECT field1,
field2,
field3
FROM table1
INSERT FIRST 100 ROWS ONLY |
_________________ Thanks |
|
Back to top |
|
 |
danm Intermediate
Joined: 29 Jun 2004 Posts: 170 Topics: 73
|
Posted: Mon Sep 22, 2008 8:17 am Post subject: |
|
|
Try:
INSERT INTO <table name>
SELECT field1,
field2,
field3
FROM table1
FETCH FIRST 100 ROWS ONLY |
|
Back to top |
|
 |
edkir98 Beginner

Joined: 27 Aug 2007 Posts: 102 Topics: 42 Location: Chennai
|
Posted: Tue Sep 23, 2008 1:16 am Post subject: |
|
|
Fetch first 100 rows only is only during select..this will not work.. _________________ Thanks |
|
Back to top |
|
 |
Dibakar Advanced

Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
|
Back to top |
|
 |
|
|