Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
更新クエリを挿入クエリの副選択に配置することは可能ですか?好き:
select * from db.testtable where col1 = 1 or (UPDATE ...);
DBエンジンに応じて、次のようなことができます。
INSERT INTO table (a,b,c) VALUES (1,2,3) ON DUPLICATE KEY UPDATE c=c+1;
重複を避け、代わりに更新します。