Article View: pl.comp.bazy-danych
Article #195174Re: [mySQL] insert/update ?
From: Borneq
Date: Tue, 03 Jan 2017 20:44
Date: Tue, 03 Jan 2017 20:44
11 lines
1314 bytes
1314 bytes
W dniu 03.01.2017 o 20:32, Borneq pisze:
> Działa bardziej jak Insert, a nie Update. Co zrobić gdy mam klucz
> primary, chcę zmienić jedno pole a wszystkie inne (czy drugie) zostawić
> bez zmian?
Wiem!
http://stackoverflow.com/questions/12218185/mysql-replace-into-only-some-fields
by eggyal
INSERT INTO gfs(localidad, fecha, pp)
VALUES('some_place', '2012-08-05 02:00', 1.6)
ON DUPLICATE KEY UPDATE pp=VALUES(pp);
Technical Details
Message-ID:
<o4h2g1$bom$1@node1.news.atman.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mailReferences:
<o4gpgv$91d$1@node2.news.atman.pl> <o4gu8v$77u$1@node1.news.atman.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail From: Borneq <borneq@antyspam.hidden.pl> Newsgroups: pl.comp.bazy-danych Subject: Re: [mySQL] insert/update ? Date: Tue, 3 Jan 2017 21:44:51 +0100 Organization: ATMAN - ATM S.A. Lines: 12 Message-ID: <o4h2g1$bom$1@node1.news.atman.pl> References: <o4gpgv$91d$1@node2.news.atman.pl> <o4gu8v$77u$1@node1.news.atman.pl> NNTP-Posting-Host: 91.239.205.105 Mime-Version: 1.0 X-Trace: node1.news.atman.pl 1483476289 12054 91.239.205.105 (3 Jan 2017 20:44:49 GMT) X-Complaints-To: usenet@atman.pl NNTP-Posting-Date: Tue, 3 Jan 2017 20:44:49 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 In-Reply-To: <o4gu8v$77u$1@node1.news.atman.pl> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit