[plug] mysql query questoin
Jon Miller
jlmiller at mmtnetworks.com.au
Sun Jan 19 21:46:04 WST 2003
I guess what I need to know is does MySQL know that the table I want the
info to go into is in another database, if not how do I tell MySQL this
information? I can understand if the two (2) tables resides in the same
database, but they don't.
JLM
On Sun, 2003-01-19 at 21:33, Onno Benschop wrote:
> On Sun, 2003-01-19 at 21:09, Anne Busby wrote:
> > Try
> >
> > INSERT INTO <table2> SELECT <fields> FROM <table>;
>
> And if you don't have field names that don't match-up, then you need to
> make it so:
>
> INSERT INTO table (field1, field2, field3) SELECT peter AS field1, paul
> AS field2, mary AS field3 FROM table2 WHERE something='fred'
--
Jon Miller <jlmiller at mmtnetworks.com.au>
MMT Networks Pty Ltd
More information about the plug
mailing list