Skip navigation links

MySQL Forums


Advanced Search

saving value of count(*)
Posted by: Jennifer Coleman ()
Date: October 10, 2009 08:20PM

in a procedure I am creating, I need to save the value of Count(*) from my select statement so I can use the value to determine if a row was selected or not. Something like below.

Select count(*) as positiontaken from position where Level=AL and Position = AP;
Set rowcount = positiontaken;
If rowcount = 0 then
Update associates
Set aLevel = AL, aPosition = AP
Where Associate_ID = AN;
insert into position Set Level = AL, Position = AP;
END IF;

How do I do this?

Options: ReplyQuote


Subject Written By Posted
saving value of count(*) Jennifer Coleman 10/10/2009 08:20PM
Re: saving value of count(*) Todd Burch 11/04/2009 06:51AM


Sorry, only registered users may post in this forum.