smallsql

Do conditional INSERT with SQL?

∥☆過路亽.° 提交于 2019-11-30 00:23:57
问题 I have a database that is updated with datasets from time to time. Here it may happen that a dataset is delivered that already exists in database. Currently I'm first doing a SELECT FROM ... WHERE val1=... AND val2=... to check, if a dataset with these data already exists (using the data in WHERE-statement). If this does not return any value, I'm doing my INSERT. But this seems to be a bit complicated for me. So my question: is there some kind of conditional INSERT that adds a new dataset