c++ - SQLite 3 prevent rows where all values are duplicates -
i'm wondering how can go creating table won't allow rows inserted finish duplicates. finish mean every value has same.
i'm okay inserting rows identical other 1 column's value, not if same.
i know can utilize insert or ignore avoid inserting duplicate rows, problem table uses auto incremented integer primary key, , insert or ignore still allow duplicate rows inserted sees auto incremented id different
ex.
running
insert or ignore table values ("a", "b" "c"); twice give me next table:
id | column | column b | column c 1. "a" "b" "c" 2. "a" "b" "c" is there way around other manually searching rows (ignoring id) duplicates?
insert or ignore check any constraint, add together 1 on fields want check:
class="lang-sql prettyprint-override">create table mytable( columna integer primary key, columnb whatever, columnc, unique (columna, columnb, columnc) ); c++ sqlite insert duplicates
No comments:
Post a Comment