I’m trying this sqlite query on an existing database and table:
INSERT INTO Actions (guide_id, user_id, action_type, action_date, article_id, guide_name) VALUES (33, 1199180, 2, 1355829894, 2457, 'Amsterdam');
This works, but if I run the same thing again it will insert duplicate values which is not wanted.
This is how the table looks like:

The problem here is that article_id is not unique.
I want the insert only to run when article_id does not exists in the column.
In theory I want something like:
IF x DOES NOT EXISTS IN article_id DO (INSERT INTO Actions (guide_id, user_id, action_type, action_date, article_id, guide_name) VALUES (33, 1199180, 2, 1355829894, 2457, 'Amsterdam'));
Is this possible?
try:
Another way would be to define the
article_idas aUNIQUEkey:You can find more information at the sqlite manual.