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.
ID = テーブル ID である行にデータを挿入するための SQL コマンドはありますか?存在しない場合は、新しい行に挿入しますか?
次のようなもの: ('INSERT INTO USERS IF EXISTS WHERE userID=ID')
次のような簡単なものを書くことができます。
IF (SELECT COUNT(t.ID) FROM t WHERE t.ID=@id)=1 UPDATE ELSE INSERT