I have the following SQL which I need to do
CREATE TABLE cars_users2 AS SELECT DISTINCT * FROM cars_users; DROP TABLE cars_users; ALTER TABLE cars_users2 R
I prefer here doc:
execute <<-SQL CREATE TABLE cars_users2 AS SELECT DISTINCT * FROM cars_users; DROP TABLE cars_users; ALTER TABLE cars_users2 RENAME TO cars_users; SQL
notice: This only works for PostgreSQL, if you are using MySQL you should set CLIENT_MULTI_STATEMENTS for the adapter.