I am having slight problem with insertion.
What I am trying to do is insert certain values into database table, but would like new values to be inserted only if there are no such values already exist in that table.
The problem is that I do not see fast solution. The slower way is to get the value then check if that value exist in that table
SELECT count FROM table where data="..."
if count > 0
than do not insert
else
insert into .....
That means I will make two requests each time I am trying to insert the value. That seems like waste of time and resources.
Is there a single query that will check against the table values and do insert only if the value does not exist there?