SELECT INTO and “Undeclared variable” error
INSERT … SELECT http://dev.mysql.com/doc/refman/5.1/en/insert-select.html INSERT INTO newsletter_to_send SELECT id_subscriber FROM subscribers PS: are you sure you don’t need in WHERE clause?
INSERT … SELECT http://dev.mysql.com/doc/refman/5.1/en/insert-select.html INSERT INTO newsletter_to_send SELECT id_subscriber FROM subscribers PS: are you sure you don’t need in WHERE clause?
I know this is a bit old, but I needed to do something similar. I wanted to insert the contents of one table into another, but in a random order. I found that I could do this by using select top n and order by newid(). Without the ‘top n’, order was not preserved and … Read more