I want to insert data in mysql Db only if 2 non key attribute are not matching for example if I am fetching tweets from twitter and i want to check if the user name and tweet matches in Db then do not insert in Db else Insert and I dont want to keep user name and tweet as key attribute now I am using IF exist but not working
IF EXISTS (SELECT * FROM twitter WHERE usernaem = 'someuser' and tweet='some tweet')
BEGIN
insert data in Db if not exists
END
but getting error in IF EXISTS, I am using mysql.