I have a table with just about 100 columns, and I would like to duplicate a
row exactly, except for one column, which is the AUTO_INCREMENT column.
Using 'INSERT INTO tbl_name SELECT * FROM tbl_name WHERE id_col = 1' doesn't
work, because it produces the following error: 'ERROR 1062: Duplicate
, col2, col3:
INSERT INTO table (col2, col3)
SELECT col2, col3 FROM table2 WHERE id_col=1;
Regards,
Matt
-Original Message-
From: Eric J. Janus [mailto:[EMAIL PROTECTED]
Sent: 29 March 2004 19:37
To: MySQL
Subject: INSERT ... SELECT question
I have a table with just about 100 columns
was hoping that MySQL had
something built in to make this easier.
Thanks,
Eric
-Original Message-
From: Matt Chatterley [mailto:[EMAIL PROTECTED]
Sent: Monday, March 29, 2004 2:11 PM
To: 'Eric J. Janus'; 'MySQL'
Subject: RE: INSERT ... SELECT question
Importance: Low
Can you
: INSERT ... SELECT question
There is only 1 table. I want to replicate a record in a table except the
AUTO_INCREMENT column.
Your solution would work, but I'd prefer to not have to maintain a list of
columns in the application. Worst case I'll have the application generate
the query based
, March 29, 2004 2:25 PM
To: 'Eric J. Janus'; 'MySQL'
Subject: RE: INSERT ... SELECT question
Importance: Low
Oh, if only there were views!! That would make this easy. Maybe soon
(*please*). :)
Another approach (more cumbersome) might be to insert the rows you need to
duplicate into a temporary
an appropriate
where-clause to the above statement.
/Henrik
-Original Message-
From: Eric J. Janus [mailto:[EMAIL PROTECTED]
Sent: den 29 mars 2004 21:28
To: Matt Chatterley; 'MySQL'
Subject: RE: INSERT ... SELECT question
Views would be nice. :)
That idea sounds like it would work
the application everytime I change the
table, which I don't always want to do.
-Original Message-
From: Henrik Schröder [mailto:[EMAIL PROTECTED]
Sent: Monday, March 29, 2004 3:07 PM
To: 'Eric J. Janus'; 'MySQL'
Subject: RE: INSERT ... SELECT question
Importance: Low
Jason Joines [EMAIL PROTECTED] wrote:
Table employees:
| idnumber | email | phone | address |
Table webusers:
-
| idnumber | userid | website |
-
Egor Egorov wrote:
Jason Joines [EMAIL PROTECTED] wrote:
Table employees:
| idnumber | email | phone | address |
Table webusers:
-
| idnumber | userid | website |
-
Jason Joines wrote:
Egor Egorov wrote:
Jason Joines [EMAIL PROTECTED] wrote:
Table employees:
| idnumber | email | phone | address |
Table webusers:
-
| idnumber | userid | website |
Table employees:
| idnumber | email | phone | address |
Table webusers:
-
| idnumber | userid | website |
-
Table employees is completely populated. Table
I use this syntax but I have privilege problem.
Thenk you anyway
- Original Message -
From: Nitin [EMAIL PROTECTED]
To: IEEIO AAOOCO [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, October 27, 2003 5:20 PM
Subject: Re: Insert ... Select question
of course, the syntax is:
insert
Hello list
I want to insert ... select data from table1 of db1 to table2 of db3.
Is that possible?
Thank in advance
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
27, 2003 8:28 PM
Subject: Insert ... Select question
Hello list
I want to insert ... select data from table1 of db1 to table2 of db3.
Is that possible?
Thank in advance
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com
... Select question
Hello list
I want to insert ... select data from table1 of db1 to table2 of db3.
Is that possible?
Thank in advance
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
--
MySQL General
At 8:44 PM -0500 9/9/01, Marcus Young wrote:
Hi,
I'm fairly new to MySQL. I'm trying to insert data into a table
where one field is derived from a SELECT on another table (a key)
and the other fields are defined directly (eg field_01=abcd) .
The formats I have been trying don't appear to be
PROTECTED]
Date: Sun, 09 Sep 2001 20:44:23 -0500
Subject: INSERT SELECT QUESTION
Hi,
I'm fairly new to MySQL. I'm trying to insert data into a table where
one field is derived from a SELECT on another table (a key) and the
other fields are defined directly (eg field_01=abcd) . The formats I
17 matches
Mail list logo