mardi 8 mars 2016

SQLite Query SET variable on a single row

I have a table called "allarmi_ingressi" in SQLite, with a lot of rows in it. I want to create a query that changes the variable on my column "visto" to 1, if "visto=0", and to 0, if "visto=1". This is what i made:

UPDATE allarmi_ingressi SET visto = '1' WHERE visto = '0'

Of course this modify every row in the column "visto";

I want to know if it's possible to modify it "selecting" it by the primary key, in my case "id_allarme".

Aucun commentaire:

Enregistrer un commentaire