I have table like this:
CREATE TABLE "Date_Table"
("Year" DATETIME ,
"Month1" INTEGER,
"Month2" INTEGER,
"ID" INTEGER)
Then i created inique index of 2 columns
CREATE UNIQUE INDEX field1_field2_idx ON table_name(Year, ID)
When i done i want to insert if there is none of this kind record and replace if there are.
INSERT OR REPLACE INTO Date_Table(Year, Month1, Month2, ID) Values(2012, 1, ?,1)
Everything is as it should be at this point, but if i do this insert:
INSERT OR REPLACE INTO Date_Table(Year, Month1, Month2, ID) Values(2012, ?, 1,1)
It replace all record deleting Month1 to NULL, but i want just update in that row Month2 column.
Maybe someone could help me on this. It's about SQLite