What kind of situation is REPLACE useful for?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

What kind of situation is REPLACE useful for?

Post by daedalus__ »

I'm just curious. I can't think of anything off the top of my head. Why not just use UPDATE?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

When you want to update a potentially existing record; if it doesn't exist, create it.
Post Reply