[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] SQL insert from another database
- Subject: [ale] SQL insert from another database
- From: cfowler at outpostsentinel.com (Chris Fowler)
- Date: Fri, 23 Jul 2010 20:49:58 -0400
- In-reply-to: <[email protected]>
- References: <1279897490.27024.15.camel@cfowler-desktop> <[email protected]>
On Fri, 2010-07-23 at 18:38 -0400, Richard Bronosky wrote:
> insert into A.users select NULL AS user_id, name from B.users;
>
> Because user_id is auto_increment, the NULL will trigger it to
> populate correctly. This is basically the same effect as using
> ()VALUES() as was also suggested.
Yes that was what I was thinking. I would need to specify each column
and I could simply use a 0 as the key if I wanted too. Unfortunately
there is a map table that maps rows of a table to a group name.
Typically when i do mass inserts I get the starting key and ending key
and do a base for loop to create a SQL file to do the mass inserts into
the mapping table. He'll have to figure that one out too.