sql - I need to create a SQLite table -
i need able enter duplicate entries in table b, different foreign keys (table b references table a's key). this:
table a: record key of 11 record key of 22 table b: record referring table record 11, field marked unique: value 101 record referring table record 22, field marked unique: value 101 <--- violates unique key
this have tried, didn't work:
create table readings ( site_id text references sitedata , loop_nbr text , loop_closed binary , seq integer , sta text unique , bs text , fs text , hi text , desc text ) insert readings (site_id, seq) values (' + databasekey + ', 0)
anybody know how this?
create table readings ( site_id text unique references sitedata , loop_nbr text , loop_closed binary , seq integer , sta text unique , bs text , fs text , hi text , desc text )
adding unique foreign key refuse rows same site_id , sta
Comments
Post a Comment