I've been trying to insert a record in the database if it does not already exists and this is the query:

```
insert into evt(e_id, t_id)
values( '1597',  '4')
where not exists( select id from evt where e_id = '4' and t_id = '1597');

```

that query returns with the following error:

> 
> ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where not exists( select id from evt where e\_id = '4' and t\_id = ' at line 1
> 
> 
> 

I can't understand why it doesn't work