Does anyone know if I can add a hint SQL_BUFFER_RESULT to INSERT .. SELECT ON
DUPLICATE
ex..
INSERT INTO foo
SELECT SQL_BUFFER_RESULT* FROM bar
ON DUPLICATE KEY UPDATE foo.X=..
Both my tables foo and bar are InnoDB; but the idea is to release the lock on
bar as soon as possible by moving
set - here is an example (the real one is
more complex than this)
LOC DATA
-
A 1
B 2
C 3
D 4
E 5
F 6
...
and I am looking to run some sort of INSERT ... SELECT on this to
make a new table like this:
LOC DATA
-
A0
2
C3
D4
E5
F6
...
and I am looking to run some sort of INSERT ... SELECT on this to
make a new table like this:
LOCDATA
-
A010
A111
A212
A313
B020
B121
B222
B323
C030
C131
C232
C333
D040
D141
D242
D3
I have an existing data set - here is an example (the real one is more
complex than this)
LOC DATA
-
A 1
B 2
C 3
D 4
E 5
F 6
...
and I am looking to run some sort of INSERT ... SELECT on this to make
a new table like this:
LOC
At 08:23 PM 7/20/2008, Perrin Harkins wrote:
On Sun, Jul 20, 2008 at 12:12 AM, mos [EMAIL PROTECTED] wrote:
Is there a way to get Insert ... select ... On Duplicate Update to
update
the row with the duplicate key?
That's what it does.
Why can't it do this?
What makes you think it can't
On Mon, Jul 21, 2008 at 11:44 AM, mos [EMAIL PROTECTED] wrote:
I can't specify all of the columns in a Set statement in the
OnDuplicate clause because I don't know what the column names are and there
could be 100 columns.
Write code to do it. There is no way around specifying the
At 11:00 AM 7/21/2008, Perrin Harkins wrote:
On Mon, Jul 21, 2008 at 11:44 AM, mos [EMAIL PROTECTED] wrote:
I can't specify all of the columns in a Set statement in the
OnDuplicate clause because I don't know what the column names are and there
could be 100 columns.
Write code to do
Insert ... select ... On Duplicate Update to
update
the row with the duplicate key?
That's what it does.
Why can't it do this?
What makes you think it can't?
- Perrin
Perrin,
I can't specify all of the columns in a Set statement in the
OnDuplicate clause because I don't know what
, Jul 21, 2008 at 11:44 AM, mos
mailto:[EMAIL PROTECTED][EMAIL PROTECTED] wrote:
At 08:23 PM 7/20/2008, Perrin Harkins wrote:
On Sun, Jul 20, 2008 at 12:12 AM, mos
mailto:[EMAIL PROTECTED][EMAIL PROTECTED] wrote:
Is there a way to get Insert ... select ... On Duplicate Update to
update
the row
On Mon, Jul 21, 2008 at 2:43 PM, mos [EMAIL PROTECTED] wrote:
I thought if MySQL found a duplicate key on the insert, it would
automatically update the existing row that it found with the results from
table1 if I left out the column expressions in the update clause. But
apparently it doesn't
On Sun, Jul 20, 2008 at 12:12 AM, mos [EMAIL PROTECTED] wrote:
Is there a way to get Insert ... select ... On Duplicate Update to update
the row with the duplicate key?
That's what it does.
Why can't it do this?
What makes you think it can't?
- Perrin
--
MySQL General Mailing List
Is there a way to get Insert ... select ... On Duplicate Update to
update the row with the duplicate key? Otherwise I'll have to use Replace
which is inefficient because it deletes the old duplicated row and then
inserts the new row with the same key. I'd much rather have it update
Hi all,
Apologies if this isn't the correct list but I couldn't see a more
suitable one.
I have 4 tables. t1 and t3 are a many to many relationship and use t2
as link table. t3 has many t4.
What I want to do is insert a new row into t3 for each row in t1. I
then want to add the
On Thu, 3 Apr 2008, Hiep Nguyen wrote:
hi all, i have a question on insert ... select statement.
tbl_1(fld1,fld2,fld3, )
fld1 int primary key auto_increment not null
tbl_2(fld_a,fld_b,fld_c,...)
how do i construct my select statement so that fld1 is auto increment?
insert into tbl_1
hi all, i have a question on insert ... select statement.
tbl_1(fld1,fld2,fld3, )
fld1 int primary key auto_increment not null
tbl_2(fld_a,fld_b,fld_c,...)
how do i construct my select statement so that fld1 is auto increment?
insert into tbl_1(fld1,fld2,fld3) select xxx, fld_b, NOW
Hi Hiep,
you can put in either xxx = NULL
or you can skip it completely:
insert into tbl_1(fld2,fld3) select fld_b, NOW() from tbl_2;
Regards,
/Johan
Hiep Nguyen skrev:
hi all, i have a question on insert ... select statement.
tbl_1(fld1,fld2,fld3, )
fld1 int primary key
On Thu, 3 Apr 2008, Johan Höök wrote:
Hi Hiep,
you can put in either xxx = NULL
or you can skip it completely:
insert into tbl_1(fld2,fld3) select fld_b, NOW() from tbl_2;
Regards,
/Johan
Hiep Nguyen skrev:
hi all, i have a question on insert ... select statement.
tbl_1(fld1,fld2
Hi Hiep,
Hiep Nguyen skrev:
On Thu, 3 Apr 2008, Johan Höök wrote:
Hi Hiep,
you can put in either xxx = NULL
or you can skip it completely:
insert into tbl_1(fld2,fld3) select fld_b, NOW() from tbl_2;
Regards,
/Johan
Hiep Nguyen skrev:
hi all, i have a question on insert ... select
, 2008 at 10:37 AM, Johan Höök [EMAIL PROTECTED]
wrote:
Hi Hiep,
you can put in either xxx = NULL
or you can skip it completely:
insert into tbl_1(fld2,fld3) select fld_b, NOW() from tbl_2;
Regards,
/Johan
Hiep Nguyen skrev:
hi all, i have a question on insert ... select
Into `request` (Required, Qty)
Values
('Apples', 12),
('Bananas', 112),
('Cherries', 5);
Now what I*d like to do is create a single Insert Select query that
creates a record in my purchase table for each of the items in my
request table based on the number of items available in my inventory
),
('Cherries',6);
Insert Into `request` (Required, Qty)
Values
('Apples', 12),
('Bananas', 112),
('Cherries', 5);
Now what I*d like to do is create a single Insert Select query that
creates a record in my purchase table for each of the items in my
request table based on the number of items available
);
Insert Into `request` (Required, Qty)
Values
('Apples', 12),
('Bananas', 112),
('Cherries', 5);
Now what I*d like to do is create a single Insert Select query that
creates a record in my purchase table for each of the items in my
request table based on the number of items available in my
Dear All,
I've just posted this to MySQLdb help forum but maybe
there is a mysql way of getting what I want and you could,
time permitting, help me.
First my setup:
* Python 2.5
* MySQL 5.0.27-standard-log (MYISAM tables)
* MySQLdb.version_info (1, 2, 2, 'gamma', 1)
I have the following
I want to add records to an attributes table for every item which does not
have an attribute of a given value. The problem is that some records have
already had these values added.
Please have a look at the following query, an INSERT ... SELECT construct
which I believe will do the job
[EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Monday, March 12, 2007 3:02 PM
Subject: INSERT ... SELECT Challenge
I want to add records to an attributes table for every item which does not have an attribute of a given value. The problem is that
some records have already had these values added
. The
index will prevent a new non-unique from being entered and the IGNORE will
prevent an error.
- Original Message - From: Miles Thompson
[EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Monday, March 12, 2007 3:02 PM
Subject: INSERT ... SELECT Challenge
I want to add records
. The
index will prevent a new non-unique from being entered and the IGNORE will
prevent an error.
- Original Message - From: Miles Thompson
[EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Monday, March 12, 2007 3:02 PM
Subject: INSERT ... SELECT Challenge
I want to add records
that?
I think it works somehow with SET @maxid = @maxid +1
But i fail combining it with INSERT SELECT :/
Any help is greatly appriciated =)
My best wishes
Barry
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
--
MySQL General Mailing List
For list
Barry schrieb:
Hello Everyone!
i forgot i am using MySQL 4.11
Greetings
Barry
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
Barry napsal(a):
Hello Everyone!
I am having a big problem with counting inserting rows.
This is my Query:
SELECT MAX(id) INTO @maxid FROM table1; // @maxid is now 44
INSERT INTO table2 (orderid, someothervars)
SELECT @maxid +1, blahvar FROM table3;
try
select @maxid:=max(id)-1 from
assumed those two field were your
primary key. The way I described in the easiest way
to implement it. Especially since you can do future insert/select without
having to worry about figureing out sequence numbers for
each group. You may want to think if you need two unique indexes.
Obviously if you
When you said multiple field unique key, I assumed those two field were your primary key. The way I described in the easiest way
to implement it. Especially since you can do future insert/select without having to worry about figureing out sequence numbers for
each group. You may want to think
ItemCount is essentially a counter of the records from the select
statement. So, every new INSERT ... SELECT statement gets a new
GroupCount (the next number up) and ItemCount represents the ID of the
items in that new group.
Does that make sense?
- Thanks
Michael Dykman [EMAIL PROTECTED] 1
to be made for each
record group.
- Original Message -
From: Ed Reed [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Friday, January 12, 2007 12:42 PM
Subject: Re: Insert ... Select troubles
ItemCount is essentially a counter of the records from the select
statement. So, every new INSERT
record group.
- Original Message -
From: Ed Reed [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Friday, January 12, 2007 12:42 PM
Subject: Re: Insert ... Select troubles
ItemCount is essentially a counter of the records from the select
statement. So, every new INSERT ... SELECT
I need some help creating an INSERT * SELECT statement that supplies a record
counter in the returned items. Here's the task,
I have t1 and t2. t1 is GroupCount, ItemCount, Field1, Field2, Field3. t2 is
Field1, Field2, Field3.
t1 has a multiple field unique key called Request that has
Hi,
Using MySQL-5.0.22/Win-XP-SP2 and storing data in InnoDB tables.
Clients connect from VB6. Enclosing all transactions in START
TRANSACTION ... COMMIT statements from VB6 clients.
I have the following query for a table tmp2 with a column x of data-type INT.
Insert into tmp2(x,y,x)
I get this error:
Fehler in
/home/virtual/site4/fst/var/www/html/adminheaven/artikel-vererben-save.php
in Zeile 36 mit Error:br
Query:INSERT INTO objektflyer_verknuepfung
(av_o_id_haupt,av_o_id_link,av_text,av_op_id) SELECT
418,av_o_id_link,av_text,av_op_id FROM objektflyer_verknuepfung WHERE
Hi Barry,
see: http://dev.mysql.com/doc/refman/5.0/en/insert-select.html
you cannot insert into a table you're doing select on
(same goes for update).
Regards,
/Johan
Barry skrev:
I get this error:
Fehler in
/home/virtual/site4/fst/var/www/html/adminheaven/artikel-vererben-save.php
Johan Höök schrieb:
Hi Barry,
see: http://dev.mysql.com/doc/refman/5.0/en/insert-select.html
you cannot insert into a table you're doing select on
(same goes for update).
But i am doing it on a test server version 5.x and it works like a charm :)
--
Smileys rule (cX.x)C --o(^_^o)
Dance for
master_list and child_list table structure are identical but data in child_list
may contain records from master_list and new records.
I have constructed query using INSERT
SELECT but I am unable to check and
filter out records that already exist in master_list.
INSERT INTO master_list
only non existent records in
master_list from a child_list. Both master_list and child_list table
structure are identical but data in child_list may contain records
from master_list and new records.
I have constructed query using INSERT…SELECT but I am unable to
check and filter out
Hi,
The following query worked fine:
INSERT INTO Allocations(Project_ID, User_ID)
SELECT P.Project_ID, U.User_ID
FROM Users U, Projects P, Clients C
WHERE P.Client_ID = C.Client_ID
AND U.Client_ID = C.Client_ID
AND Project_ID =.$project_id)
However I want to add a column to the INSERT part of
)
Met vriendelijke groet,
Almar van Pel
-Oorspronkelijk bericht-
Van: Shaun [mailto:[EMAIL PROTECTED]
Verzonden: woensdag 23 november 2005 15:22
Aan: mysql@lists.mysql.com
Onderwerp: INSERT SELECT Problem
Hi,
The following query worked fine:
INSERT INTO Allocations(Project_ID, User_ID
YES_COLUMN with the column name that stores the 'Yes' values.
Best regards,
Diego Wald
- Original Message -
From: Shaun [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Wednesday, November 23, 2005 11:21 AM
Subject: INSERT SELECT Problem
Hi,
The following query worked fine:
INSERT
Hi,
I have four tables: Projects, Users, Allocations and Clients. A Client will
have many projects and many Users, Users are allocated to Projects via a
link table - Allocations. When I add a project I want to have an option of
allocating all users to the project, can this be done with a
Sorry guys,
Worked it out, if anyone is interested here is the query:
INSERT INTO Allocations(Project_ID, User_ID)
SELECT P.Project_ID, U.User_ID
FROM Users U, Projects P, Clients C
WHERE P.Client_ID = C.Client_ID
AND U.Client_ID = C.Client_ID
AND Project_ID = 2
Shaun [EMAIL PROTECTED] wrote in
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Today mysql 4.1.8 has a segmentation fault (signal 11), and crashed.
In the process one table was left corrupted, when it started back up.
An application continued to call insert...select on the corrupted table
as it wasn't realized this happened
Hi all
I want to 'copy' the contents of the table 'cart', where userid=... to the
table pending_cart.
Here is some example data for the table 'cart'
++++-+
| id | userid | prodid | qty |
++++-+
| 25 |123 | 15 | 1 |
| 23 |124 | 14
released
under the GPL2 and that are meant for use with a
php cli binary:
http://www.vlaamse-kern.com/sas/
--
--
[attachment attfzmu4.dat deleted by Shawn Green/Unimin]
This is what you posted as the results of your test INSERT...SELECT. Look
at it again (carefully this time):
Query OK
Hi
I got a reply offlist from Shawn Green telling me to check my indexes on table
pending_cart.
As it turned out, the primary index (id) did not have its auto_increment bit
set.
ALTER TABLE `pending_cart`
CHANGE `id`
`id` INT( 11 )
DEFAULT '0'
NOT NULL
Hi,
I have tables with only 2 fields, key (char(30)) and value(blob), the value is
about 2K.
The table is going to store more than 20 million entries. I will keep
inserting, selecting and deleting the table. I wonder what will the best way
be to construct table, i.e., how should I do
- Original Message -
From: Aragorn [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Saturday, March 12, 2005 1:47 AM
Subject: insert - select from two different applications race condition?
I have a simple problem...
I'm using mysql 4.1.9/innodb table and two small python
I have a simple problem...
I'm using mysql 4.1.9/innodb table and two small python applications A and B
first application A is executed, and do a simple INSERT into a table
then application B is executed:
- B does a SELECT in the same table, that should return the entry
created by application A
Thanks Shawn, Sergei.
I'll get onto the new version as soon as I can.
Tom.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Hi!
On Feb 24, Tom Cunningham wrote:
It appears you can't combine an insert-select with an on-duplicate-key-update.
You can, since 4.1.10
(and there're some problems with name resolution there, so better wait
for 4.1.11 - search bugdb for details)
Regards,
Sergei
It appears you can't combine an insert-select with an on-duplicate-key-update.
I would find it very useful if you *could* do this. I know it would be
complicate how you would handle the syntax for what to do when you hit
a duplicate key, could do this: update all the columns
Tom Cunningham [EMAIL PROTECTED] wrote on 02/24/2005 11:31:31 AM:
It appears you can't combine an insert-select with an
on-duplicate-key-update.
I would find it very useful if you *could* do this. I know it would be
complicate how you would handle the syntax for what to do when you hit
How do you you get the next auto increment value? I think I'm running
into the insert...select problem. I want to duplicate records from one
table to the _same_ table, with an incremented auto increment value.
Can I do something like this:
insert into table (autoincrement_key, field1, field2
On Tue, 2005-02-15 at 17:56, steve cooley wrote:
How do you you get the next auto increment value? I think I'm running
into the insert...select problem. I want to duplicate records from one
table to the _same_ table, with an incremented auto increment value.
Can I do something like
I need to execute an INSERT...SELECT query.
INSERT HIGH_PRIORITY INTO stations_data
(station_id,
Tmin,
Tmax,
Tmed,
RHmin,
RHmax,
RHmed,
rain,
Wmax,
slpres,
insertion_date)
(
SELECT
stations.station_id AS stId,
min(stations_rt_data.T) AS tmax
mysql INSERT INTO Employee.tblNiiEmployee (empEmail)
- SELECT b.Email_Address
- FROM Employee.tblNiiEmployee a LEFT OUTER JOIN UserDB.Corporate b
- ON(a.empUsrName = b.Unix_Username)
- WHERE b.Email_Address IS NOT NULL;
Since versions prior to 4.0.14 do not support using the same
[snip]
mysql INSERT INTO Employee.tblNiiEmployee (empEmail)
- SELECT b.Email_Address
- FROM Employee.tblNiiEmployee a LEFT OUTER JOIN UserDB.Corporate b
- ON(a.empUsrName = b.Unix_Username)
- WHERE b.Email_Address IS NOT NULL;
Since versions prior to 4.0.14 do not support using
hi...
trying to figure out how to structure an insert/select for a multiple table
situation...
sort of...
insert table1, table2 (table1.item1, table1.item2, table2.item1,...)
select
a.q1, b.q2
from a1
left join a2
on a2.t=a1.t
where a2.r='4';
i can't seem to figure out the syntax
bruce wrote:
hi...
trying to figure out how to structure an insert/select for a multiple table
situation...
sort of...
insert table1, table2 (table1.item1, table1.item2, table2.item1,...)
select
a.q1, b.q2
from a1
left join a2
on a2.t=a1.t
where a2.r='4';
i can't seem to figure out
, September 01, 2004 10:06 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: insert/select for multiple tables...
bruce wrote:
hi...
trying to figure out how to structure an insert/select for a multiple
table
situation...
sort of...
insert table1, table2 (table1.item1, table1
At 10:52 -0700 9/1/04, bruce wrote:
michael...
it was meant as an example, to convey what i want to do, which is do a
simltaneaous insert into multiple tables at the same time. the syntax
concerning the left join/elements to be inserted was not intended to be
syntacticly (sp?) correct!!!
and as i
to you now...
-regards
-Original Message-
From: Michael Stassen [mailto:[EMAIL PROTECTED]
bruce wrote:
hi...
trying to figure out how to structure an insert/select for a multiple
table
situation...
sort of...
insert table1, table2 (table1.item1, table1.item2, table2.item1,...)
select
The question:
Is there anything in MySQL that will allow me to determine, accurately, the
last auto-incremented field from a particular database, so I can then insert
based upon this into another table? What if 2 users input at the same time?
Please see the 'long explanation' for further
Since you should still have the same information that you used to create
your entry in the candidate table you can do something like:
SELECT @candidateID := Candidate_ID
FROM candidate
WHERE Last_Name = '$lastname'
AND First_Name = '$firstname'
AND Middle_Initial = '$middle'
Yes, LAST_INSERt_ID(). It's connection-specific, not db-specific. Because
it is connection-specific, your 2-users issue is avoided. See the manual
for the details http://dev.mysql.com/doc/mysql/en/Getting_unique_ID.html.
Michael
Eve Atley wrote:
The question:
Is there anything in MySQL that
Hi,
Using the following query I am attampting to insert the Work_Type_IDs from
Work_Types WHERE Project_ID = 'x'. However I also wan to insert the
Project_ID into the table, how would this syntax work - apperently the
column count is incorrect...
INSERT INTO Letter_Templates (Work_Type_ID,
thornburgh [mailto:[EMAIL PROTECTED]
Sent: 07 July 2004 13:37
To: [EMAIL PROTECTED]
Subject: INSERT SELECT
Hi,
Using the following query I am attampting to insert the Work_Type_IDs from
Work_Types WHERE Project_ID = 'x'. However I also wan to insert the
Project_ID into the table, how
Hello ,
I'm working on a project with MySql 4.0.12-log.
I have a problem with insert .. select:
To describe the program of some touristic tours I create two tables:
TOUR that contains the data
TAPPE that contains the program of the tour.
(relation 1:n).
To keep track of each tour i create two
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
stephen [EMAIL PROTECTED] wrote:
mysql use zzz
Database changed
mysql create table category
- (
- id tinyint(4) NOT NULL auto_increment,
- name varchar(20) NOT NULL,
- parent tinyint(4) NULL,
- primary key(id)
- );
Query OK, 0 rows affected (0.00
Hi,
How could I do this insert/select?
create table category
(
id tinyint(4) NOT NULL auto_increment,
name varchar(20) NOT NULL,
parent tinyint(4) NULL,
primary key(id)
);
insert into category (name, parent) values('cc_1',null);
insert into category (name, parent) select 'cc_2a
-- excerpt --
[]s,
Conrado
- Original Message -
From: stephen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 16, 2004 2:57 AM
Subject: How could I do this insert/select?
Hi,
How could I do this insert/select?
create table category
[EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 15, 2004 10:57 PM
Subject: Re: How could I do this insert/select?
It seems to work on my MySQL (4.0.18).
Tell us which version are you using and the error code/message returned.
-- excerpt
Hello to all:
I am attempting to move two columns of data into a large table by using
the insert into . select . construct. My problem is that I need to
join to the table I am inserting to. To get around this my idea is to
create a temporary database and populate it with the table then join
Perhaps I'm misunderstanding what you want, but could you create your
temporary table as the result of your construct, then insert it into
your table? If I'm reading you correctly, I think that would involve
less data in the temporary table, so might be faster overall. Something
like:
Boyd E. Hemphill [EMAIL PROTECTED] wrote:
I am attempting to move two columns of data into a large table by using
the insert into . select . construct. My problem is that I need to
join to the table I am inserting to. To get around this my idea is to
create a temporary database and populate
Does anyone know this?
In the 4.0.17 and later build, the target table of an INSERT...SELECT can be
the same as the SELECT table (insert into table1...select ...from table1).
Does the process essentially happen in a natural lock? In other words,
could the table change between the data retrieved
In the 4.0.17 and later build, the target table of an INSERT...SELECT can be
the same as the SELECT table (insert into table1...select ...from table1).
Does the process essentially happen in a natural lock? In other words,
could the table change between the data retrieved in the select
Luis Lebron [EMAIL PROTECTED] wrote:
I am try to copy a couple of fields from one table to another. Here is my
query
Insert into users_test (firstName, lastName) Select firstName, lastName from
users;
The users table has 1,263 rows. However, only 1 row is inserted into
users_test.
I am try to copy a couple of fields from one table to another. Here is my
query
Insert into users_test (firstName, lastName) Select firstName, lastName from
users;
The users table has 1,263 rows. However, only 1 row is inserted into
users_test.
If I perform the following query
Insert into
?
If I've got you right you need UPDATE, not INSERT .. SELECT.
UPDATE webuser, employees
SET webuser.userid=employees.email
WHERE webuser.idnumber=employees.idnumber;
The above UPDATE statement will work from v4.0.4.
--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
?
If I've got you right you need UPDATE, not INSERT .. SELECT.
UPDATE webuser, employees
SET webuser.userid=employees.email
WHERE webuser.idnumber=employees.idnumber;
The above UPDATE statement will work from v4.0.4.
You've got it right, I was way off trying to use an INSERT instead of
an UPDATE
in the webusers table?
If I've got you right you need UPDATE, not INSERT .. SELECT.
UPDATE webuser, employees
SET webuser.userid=employees.email
WHERE webuser.idnumber=employees.idnumber;
The above UPDATE statement will work from v4.0.4.
You've got it right, I was way off trying to use an INSERT
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
1 - 100 of 165 matches
Mail list logo