How would I pull records from one table that met a certain condition and then write them to a new table.
I kinda have an idea
select * from `catagory1` where x = '4'; then insert "stuff from above query" into `catagory2`.
I know basic selects and such but how would I do the above?
Thanks,
Jesse
If the two tables are the same stucture, you could use
INSERT INTO newTable SELECT * FROM oldTable WHERE x = '4'
If they aren't the same structure, you'll need to specify the columns you are pulling and inserting.
thanks man that is what i was looking for =)
after reviewing my table strucutre they are only slightly different in column order only. How would I execte the query mapping secific colums?
Thanks in advance,
Well, something like this
INSERT INTO newTable (field1, field2, field3) SELECT field1, field2, field3 FROM oldTable WHERE x = '4'