title: how to insert if exist update (no unique key)
body: <p>i have 3 tables (sample),no key restrictions<br>
  one is FRUITTABLE, second is FRUITPRICE, third is COMBINATIONS<br>
  in FRUITTABLE, we insert what is being sold, color(ie,banana green or yellow),taste,<br>
  in FRUITPRICE, we insert how many piece, if applicable pack and the time it was sold<br></p>
  
  <p>this is how i create combinations<br></p>
  
  <pre><code>SELECT FT.FRUITS,  FT.COLOR, FT.TASTE, COUNT(FP.SALES) AS TOTAL, FP.TIMESOLD
  FROM FRUITSTABLE FT
  JOIN FRUTSPRICE FP  ON FT.ID = FP.ID
  WHERE FP.TIMESOLD BETWEEN '2013-12-01 11:00:00' AND '2013-12-01 12:00:00'
  GROUP BY FT.FRUITS, FT.COLOR, FT.TASTE
  </code></pre>
  
  <p>in the COMBINATIONS table, what we do is we group it and count so we will see what is most likely good fruit combination per hour<br></p>
  
  <p>SO COMBINATIONS WILL OCCUR ONCE EVERY HOUR<br></p>
  
  <p>lets say<br></p>
  
  <p>ie: mango,yellow,sour,10, 3:00PM<br>
  ie: mango,yellow,sour,12, 4:00PM<br>
  ie: mango,yellow,sour,14, 5:00PM<br>
  ie: mango,yellow,sour,10, 6:00PM<br></p>
  
  <p>so evey hour, lets say 3:00PM<br>
  we insert <br>
  mango,yellow,sour,1, 3:00PM<br>
  then another customer bought this combination at the same hour so the data will be<br>
  mango,yellow,sour,2, 3:00PM<br></p>
  
  <p>now, in combinations, we insert it. but if the combination already exist,
  i honestly dont know how i can update it.. 
  we need to update it lets say every 5min, maybe i can manage to create SP and EVENT that will
  call SP(hoping this is correct)</p>
  
  <p>the only problem is i dont know how to:
  select, insert, if exist(the combinations of FT.FRUITS, FT.COLOR, FT.TASTE are same) update
  <br>
  pls let me know if what im thinking is possible or not..<br>
  thanks in advance</p>
  
  <p>PS. i already used insert on duplicate key update in some cases
  <br>
  PS. we determine the group combination and total sales(FP.SALES) per hour(TIMESOLD)
  <br><br>
  EDIT<br><br>
  PS replace into is not applicable as well
  <br>
  also the reason why i cant use a unique key is because it will be useless.. <br>
  because each combination will occur every hour.. honestly, <br>
  i already have solution. but it wont be updated every minute,<br>
  my solution will be insert it every hour. <br>
  the negative side of doing that is the record in the webpage will not be in real time
  <br>
  all i need to figure out is how i can do something LIKE <br>
  insert on duplicate key update (but without using primary key)<br>
  so that the table will be updated and the record will be in real time
  if its possible to create a workaround<br>
  <br></p>
  
  <p>sorry if i have to edit the question many times. i hope this one is constructive.. thank you for your help guys...</p>