Find knowledge base article(s) by searching for keywords in the title e.g. type linux in the search box below
Find knowledge base article(s) by browsing the subject categories of articles
Technology quick references, cheatsheets, user manuals etc.
Shop Online through ShopifyLite
Tutorials on various IT applications.
Search Title    (UL:0 |SS:f)

Software >> Services >> RDBMS >> MySQL >> What are some example usage of the IF function

following example will set newordering to the value of '1' if the result of earlier query makes @catcount NULL, otherwise it will be set as @catcount+1

SET @catcount = (SELECT MAX(ordering) FROM `jos_sobi2_cat_items_relations` WHERE `catid` = '39');
SET @newordering = (SELECT IF(@catcount,@catcount+1,1));
 

[ © 2008-2021 myfaqbase.com - A property of WPDC Consulting ]