I have this table:
rating | businessId | userId
============================
  1          200        1
  2.5        200        2
the user can't has two rows with the same businessId, for example:
    rating | businessId | userId
    ============================
      1          200        1
      2.5        200        1
this's incorrect;
my server receive the businessId,userId and rating.
then it should update the row which has the same userId, and businessId if exist, else create new row.
How could I implement that with one query ?
 
     
    