I want to use the INSERT ... SELECT syntax to rapidly add data into a table, using some data from another table. In my SELECT statement I want to have a constant integer as first field and a field of the FROM table as second. So I tried:
INSERT INTO table1 (filed1,field2) SELECT 1,field3 FROM table2;
but I had some strange behaviour!
When trying just the SELECT statement it gives me:
SELECT 1,field3 FROM table2
and so on.
If I try the following, it gives me what I want:
SELECT 10,field3 FROM table3
Has anyone an idea why it does not behave the same way? Quotes are not helping, the only workaround was to add a '+' sign before 1!