I'm trying to make an insert statement from a selection.
I'm using the following SQL statement:
INSERT link (cat_id, name, url, weight, target, link_tip, made, changed, status)
SELECT 645 AS cat_id, name, url, 5 AS weight, target, link_tip, NOW() AS made, NOW() AS changed, status
FROM link WHERE link_id IN (4636, 4678, 4968);
I use it to duplicate multiple [links] (urls) to a different [category]. Every [category] has an auto-increment id as well as every [link].
when i use this statement it returns an error 1066: not unique table/alias: 'link'
what am i doing wrong??? Can anyone help me with this???
Thanks,
Vincent
I'm using the following SQL statement:
INSERT link (cat_id, name, url, weight, target, link_tip, made, changed, status)
SELECT 645 AS cat_id, name, url, 5 AS weight, target, link_tip, NOW() AS made, NOW() AS changed, status
FROM link WHERE link_id IN (4636, 4678, 4968);
I use it to duplicate multiple [links] (urls) to a different [category]. Every [category] has an auto-increment id as well as every [link].
when i use this statement it returns an error 1066: not unique table/alias: 'link'
what am i doing wrong??? Can anyone help me with this???
Thanks,
Vincent