[snip]
[snip]
INSERT INTO `table2` (`columnnames`)
SELECT `columnnames`
FROM `table1`

If this is valid SQL surely grave accents are not?
[/snip]

Actually? MySQL supports the use of grave accents around table and
column names. I use them here for emphasis. In certain cases, with older
versions of MySQL, I encourage our developers to always use them.


Well, never mind then.
I thought only apostrophes were valid.
[/snip]

You would use apostrophes around the data itself. Consider this...

INSERT INTO `table2` (`columnA2`, `columnB2`)
SELECT `columnA1`, `columnB1`
FROM `table1`
WHERE `columnA1` = 'this data'
AND `columnB1` = 'that data'

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to