Andreas Görtz: mysql

Beitrag lesen

Hi,

#1064 - You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION
SELECT  'en', keyval, en
FROM translation
WHERE ( en IS

ja - das liegt an der Klammerung, die hat da nichts zu suchen. So hat es bei mir funktioniert:

INSERT INTO
    translation1 (lang, keyval, trans)
SELECT 'de',keyval,de
    FROM translation WHERE (de IS NOT NULL)
UNION SELECT 'en',keyval,en
    FROM translation WHERE (en IS NOT NULL)
UNION SELECT 'fr',keyval,fr
    FROM translation WHERE (fr IS NOT NULL)
UNION SELECT 'it',keyval,it
    FROM translation WHERE (it IS NOT NULL)
UNION SELECT 'es',keyval,es
    FROM translation WHERE (es IS NOT NULL)
UNION SELECT 'el',keyval,el
    FROM translation WHERE (el IS NOT NULL)
UNION SELECT 'nl',keyval,nl
    FROM translation WHERE (nl IS NOT NULL)

Gruß,
Andreas.