faqts : Computers : Databases : MySQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

16 of 30 people (53%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

When using UPDATE where var = case , how can I make Mysql INSERT this row if it does not exist yet?

Jan 15th, 2002 00:36
Carsten Pedersen, tony dermont,


You probably want to use REPLACE rather than UPDATE/INSERT. This will 
replace any existing records having the same keys as your new data.