Hi,
I have a table with columns
record_id, sender, sent_time, status and in case there isn't any record of a particular sender, for example sender1, I have to insert a new record otherwise I have to update the existing record which belongs to user1.
So if there isn't any record already stored, I would execute
INSERT INTO messages (sender, sent_time, status) VALUES (@sender, time, @status) (record_id is auto_ncrementing field).
Otherwise I would execute update statement.
Anyway.. does anyone know how to combine these two statements in order to insert a new record if there isn't any record where the field sender value is "user1" otherwise update the existing record?
Thank you!