0

質問があります

SELECT IF((select COUNT(*) from produkty where name='ASROCK 760GM-GS3' and id_nokaut='7507601876693181035' and found ='0')=0, (insert into produkty (
         id_nokaut,
         name,
         shop_count,
         offer_count,
         price_min,
         price_max,
         price_avg,
         url,
         opis,
         socket,
         typ_pamieci,
         co,
         image_mini,
         image_medium,
         image_large,
         rate,
         thumbnail,
         image,
         found)
         values(
         '7507601876693181035',
         'ASROCK 760GM-GS3',
         '4',
         '4',
         '171,31',
         '195,00',
         '179,88',
         'http://www.nokaut.pl/plyty-glowne/asrock-760gm-gs3.html',
         'ASRock 760GM-GS3... ',
         'false',
         'false',
         'plyta',
         'http://nokautimg1.pl/p-da-99-da99e9e7b3eaebef049d1234fc5c15dc90x90/asrock-760gm-gs3.jpg',
         'http://nokautimg1.pl/p-da-99-da99e9e7b3eaebef049d1234fc5c15dc130x130/asrock-760gm-gs3.jpg',
         'http://nokautimg1.pl/p-da-99-da99e9e7b3eaebef049d1234fc5c15dc500x500/asrock-760gm-gs3.jpg',
         '0.00',
         'http://nokautimg1.pl/p-da-99-da99e9e7b3eaebef049d1234fc5c15dc90x90/asrock-760gm-gs3.jpg',
         'http://nokautimg1.pl/p-da-99-da99e9e7b3eaebef049d1234fc5c15dc130x130/asrock-760gm-gs3.jpg',
         '1')), (update produkty set  id_nokaut = '7507601876693181035', shop_count = '4', offer_count = '4', price_min = '171,31', price_max = '195,00', price_avg = '179,88', url = 'http://www.nokaut.pl/plyty-glowne/asrock-760gm-gs3.html', opis = 'ASRock 760GM-GS3... ',  socket = 'false', typ_pamieci = 'false', co = 'plyta', image_mini = 'http://nokautimg1.pl/p-da-99-da99e9e7b3eaebef049d1234fc5c15dc90x90/asrock-760gm-gs3.jpg', image_medium = 'http://nokautimg1.pl/p-da-99-da99e9e7b3eaebef049d1234fc5c15dc130x130/asrock-760gm-gs3.jpg', image_large = 'http://nokautimg1.pl/p-da-99-da99e9e7b3eaebef049d1234fc5c15dc500x500/asrock-760gm-gs3.jpg', rate = '0.00', thumbnail = 'http://nokautimg1.pl/p-da-99-da99e9e7b3eaebef049d1234fc5c15dc90x90/asrock-760gm-gs3.jpg', image = 'http://nokautimg1.pl/p-da-99-da99e9e7b3eaebef049d1234fc5c15dc130x130/asrock-760gm-gs3.jpg', found = '1' where  name = 'ASROCK 760GM-GS3')); 

MySQLで実行しようとしていますが、miエラーが発生します:

4 行目の ERROR 1064 (42000): SQL 構文にエラーがあります。1 行目の near 'into produkty ( id_nokaut, name, shop_cou' を使用する正しい構文については、MySQL サーバーのバージョンに対応するマニュアルを確認してください。

何が悪いのかわからない、誰か助けてくれる?

ありがとう

4

1 に答える 1

3
INSERT
INTO    produkty (id_nokaut, name, ...)
VALUES  ('7507601876693181035', 'ASROCK 760GM-GS3', ...)
ON DUPLICATE KEY
UPDATE
        shop_count = VALUES(shop_count),
        offer_count = VALUES(offer_count),
        ...
于 2012-04-26T17:02:58.613 に答える