RE: insert into... select... duplicate key

2005-09-25 Thread Schimmel LCpl Robert B \(GCE 2nd Intel Bn Web Master\)
Subject: Re: insert into... select... duplicate key Relevant bits of the conversation so far, with my thoughts at the end: Schimmel LCpl Robert B (GCE 2nd Intel Bn Web Master) wrote: > Here is the problem that I am having. I am trying to make a copy of a > full record in a table that has a p

Re: insert into... select... duplicate key

2005-09-25 Thread Michael Stassen
Relevant bits of the conversation so far, with my thoughts at the end: Schimmel LCpl Robert B (GCE 2nd Intel Bn Web Master) wrote: Here is the problem that I am having. I am trying to make a copy of a full record in a table that has a primary key with auto-increment. The real problem is that I

Re: insert into... select... duplicate key

2005-09-25 Thread Danny Stolle
I am not familiour with Cold Fusion but: cant you use 'show columns from table' ?? and use the result object? This normally works in e.g. C or PHP danny Schimmel LCpl Robert B (GCE 2nd Intel Bn Web Master) wrote: I am using Cold Fusion and as I stated in my original message, if I were using

RE: insert into... select... duplicate key

2005-09-25 Thread Schimmel LCpl Robert B \(GCE 2nd Intel Bn Web Master\)
I am using Cold Fusion and as I stated in my original message, if I were using MySQL 5, then I could use information_schema to retrieve the column names in the table and do it with variables in Cold Fusion. I do that on all my pages on the MySQL 5 servers with which I work. However, the server I am

Re: insert into... select... duplicate key

2005-09-25 Thread Danny Stolle
Well I haven't realy found a select method in which you can isolate a field. Like a complementary method, in which you select like one field, but shows the fields except the field which you have used in your select-statement. So you excually want to dynamically insert the records, not knowing

RE: insert into... select... duplicate key

2005-09-25 Thread Schimmel LCpl Robert B \(GCE 2nd Intel Bn Web Master\)
That is the effect that I am looking for, but exactly the method that I am trying to avoid. If I type the column names into my INSERT... SELECT and someone later adds a column to the table, I would have to go back into my program and update the statement. I am looking for a way to do it dynamically

Re: insert into... select... duplicate key

2005-09-25 Thread Danny Stolle
Hi, I am hoping you meen this: You have to use the fields in your into -statement and select statement, not including the field having the auto-numbering so if e.g. field1 has autonumbering -> insert into table1 (field2, field3) select (field2, field3) from table1; autonumbering will automat

Re: INSERT INTO ... SELECT

2004-04-01 Thread Egor Egorov
"Ricardo Lopes" <[EMAIL PROTECTED]> wrote: > I have to copy some records from one table into the same table is it > posible? > > my sql is like this: > > INSERT INTO equipamento_componentes (cod_equipamento_componentes, cod_tipo, > numero, data_colocacao, cod_componente) > > SELECT '', 'C', 65,

Re: INSERT INTO SELECT

2004-03-04 Thread Jacque Scott
OK, I found the answer. CREATE TABLE ProductSums SELECT DISTINCTROW IndenturedList.NSIPartNumber, Sum(tblInvTransaction.Qty) AS SumOfQty FROM IndenturedList;

Re: INSERT INTO () SELECT...

2002-11-21 Thread Jocelyn Fournier
day, November 22, 2002 12:30 AM Subject: Re: INSERT INTO () SELECT... > Hi Eric, > >thats oracle function INSERT INTO ... SELECT. it doesn't work in >mysql. > >Mirza >[EMAIL PROTECTED] > > __ > 21.11.2002

Re: INSERT INTO () SELECT...

2002-11-21 Thread Mirza Muharemagic
Hi Eric, thats oracle function INSERT INTO ... SELECT. it doesn't work in mysql. Mirza [EMAIL PROTECTED] __ 21.11.2002 22:13 > Hi, > This should work, I think, but doesn't > INSERT INTO holds (ord_num) > SELECT orders.ord_num FROM orde

RE: INSERT INTO () SELECT...

2002-11-21 Thread Jennifer Goodie
http://www.mysql.com/doc/en/INSERT_SELECT.html You cannot select from the table you are inserting into. Insert into a temp table and then insert into holds from that table. -Original Message- From: Eric [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 21, 2002 1:14 PM To: [EMAIL PROTE

Re: INSERT INTO ... SELECT question

2002-11-14 Thread Paul DuBois
At 11:15 -0600 11/14/02, Greg Macek wrote: Thanks for the tip! Looks like I can change my date_archived field to timestamp(8), since all I care about for this is the date information (actual time is useless to me). My sql query all of a sudden got a lot simpler. Thanks again for the help! TIMEST

Re: INSERT INTO ... SELECT question

2002-11-14 Thread Greg Macek
Thanks for the tip! Looks like I can change my date_archived field to timestamp(8), since all I care about for this is the date information (actual time is useless to me). My sql query all of a sudden got a lot simpler. Thanks again for the help! On Thu, 2002-11-14 at 11:07, Matthew Baranowski wr

Re: INSERT INTO ... SELECT question

2002-11-14 Thread Matthew Baranowski
Hey Greg: A slightly easier way to do this is to use a "timestamp" field. Timestamp is just a standard mysql data type. When a record is added, it records the current time. When a record is updated, the timestamp field will be set to the time of the update. http://www.mysql.com/doc/en/DATETIME.ht

Re: INSERT INTO ... SELECT question

2002-11-14 Thread Greg Macek
Well, amazingly enough, it works great! I found a test box to try it on first before implementing this on the production box. This will definitely make life easier... On Thu, 2002-11-14 at 10:14, gerald_clark wrote: > Did you try it? > Did it work? > > Greg Macek wrote: > > >Hello, > > > >I rec

Re: INSERT INTO ..... SELECT

2002-05-01 Thread Dave
This was resolved by adding an auto-increment column. MySQL does not seem capable of coping with the situation below. - Original Message - From: "Dave" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, April 30, 2002 5:36 PM Subject: INSERT INTO . SELECT > I am having pro

Re: INSERT INTO SELECT ??

2001-10-03 Thread Paul DuBois
At 12:53 PM +0800 10/3/01, chong wee siong wrote: >Hi DBAs: > I want to copy TableA in DatabaseA to TableB in DatabaseB >with changes in the attributes of the tables, what options do I have? > >I tried these: > >a) insert into TableB (id) select (id) from DatabaseA.TableA; >this works >b) insert