Hi, I have the following in one of my queries to avoid using auto increment. I 
was using MSSQL and am now using mySql. I am assuming that mySql does not have 
the DECLARE function...What would the mySql syntax be?

 DECLARE @maxid int
   BEGIN
   SELECT  @maxid = MAX(cat_ID)
   FROM   categories
   IF    @maxid IS NULL
   SELECT   @maxid = 1
   ELSE
   SELECT   @maxid = @maxid + 1
   END

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257746
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to