Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if not exists problem

Status
Not open for further replies.

plork123

Programmer
Mar 8, 2004
121
GB


hi all

i'm trying to do an 'if not exists statement... ' but it errors in the query window

this is my code


if not exists (select 1 from mytable where field1 = ??? and field2 = ???) then
insert into mytable values ('???','???','???');
else
update mytable set field3 = '???' where field1 = ??? and field2 = ???;
end if;


i'm using mysql version 4.0.25, does anyne know how i can do this statement in mysql 4.0.25?

thanks for any help

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top