Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
-
anjanesh
- DevNet Resident
- Posts: 1679
- Joined: Sat Dec 06, 2003 9:52 pm
- Location: Mumbai, India
Post
by anjanesh »
I have
Code: Select all
UPDATE `table1` SET `field1` = 'a' WHERE `ID` = '123'
If 123 doesnt exist then create (INSERT) it.
Is there a way to do this in one SQL statement in MySQL ?
Thanks
Last edited by
anjanesh on Tue Aug 02, 2005 10:36 am, edited 1 time in total.
-
sulen
- Forum Commoner
- Posts: 79
- Joined: Wed Jul 09, 2003 4:55 pm
- Location: los angeles
-
Contact:
Post
by sulen »
It is possible ...........but you need to use stored procedures for that ........ you might want to look at stored procedures for mysql