I am trying to structure a MYSQL query so that I update a row if a where condition is met else I perform an insert.
So I am collecting stats on a per hour basis, so if I already have a a row for the current hour I simply update the stats. If not I create a new row for the new hour.
I would normally do an initial query to check if a row exists, then either update or insert on the second query.
Is there a way to combine this into 1 query?