Looking at http://dev.mysql.com/doc/refman/5.6/en/insert-select.html I
*think* it would be:

INSERT
INTO yournewtable
SELECT *
FROM oldtable
WHERE conditions

So this statement:
INSERT INTO musiconly SELECT * FROM carts WHERE carts.GROUP_NAME = 'MUSIC'

should(!) copy all the data for MUSIC carts from the Rivendell database to
a table named "musiconly".  If you wanted only specific columns you'd
replace "*" with "(col1,col2,...)".



On Tue, Jan 28, 2014 at 12:49 PM, Cowboy <[email protected]> wrote:

> On Tuesday 28 January 2014 03:16:20 pm Chris Howard - CBR wrote:
> > SQL is not procedural.
> > It is all about result sets.
> > So don't think of it like a loop or something.
> >
> > Every statement but INSERT has to have a WHERE clause
> > attached to it in order to limit the rows being changed
> > or the rows being selected.  The WHERE clause is the filter
> > and the crux of it.
>
>  My brain functions IF, THEN, ELSE.
>  The rest is syntax, and the limitations of the chosen language.
>  I'm having trouble with syntax, and the limitations of the
>  language, AND the limitations of how one talks to mysql.
>
>  And, that it got stupid busy here today.
>  I'm getting nothing done, spinning wheels.
>
> --
> Cowboy
>
> http://cowboy.cwf1.com
>
> So, what's with this guy Gideon, anyway?  And why can't he ever
> remember his Bible?
>
> _______________________________________________
> Rivendell-dev mailing list
> [email protected]
> http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev
>



-- 
druidlabs.wordpress.com
flickr.com/photos/druidlabs/sets
_______________________________________________
Rivendell-dev mailing list
[email protected]
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev

Reply via email to