本文介绍了if条件为sql查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 if(a.WH_NO = b.WH_NO) 选择a.PRODUCT_NO,b.PRODUCT_NAME,a.QTY_IN,b.QTY_OUT,a.UNIT_COST FROM STOCKDETAILS a,STOCKDETAILS b WHERE.PRODUCT_NO = b.PRODUCT_NO和a.WH_NO ='WH1'和a.STOCK_JR ='IN'和b.STOCK_JR ='OU' if(a.WH_NO!= b.WH_NO) SELECT a.PRODUCT_NO,b.PRODUCT_NAME,a.QTY_IN,a.UNIT_COST FROM STOCKDETAILS a, STOCKDETAILS b WHERE.PRODUCT_NO = b.PRODUCT_NO和a.WH_NO ='WH1'和a.STOCK_JR ='IN'和b.STOCK_JR ='OU' i希望这些查询在单个结果集上执行解决方案 if(a.WH_NO=b.WH_NO)SELECT a.PRODUCT_NO,b.PRODUCT_NAME,a.QTY_IN,b.QTY_OUT,a.UNIT_COST FROM STOCKDETAILS a, STOCKDETAILS b WHERE a.PRODUCT_NO=b.PRODUCT_NO and a.WH_NO='WH1' AND a.STOCK_JR='IN' AND b.STOCK_JR='OU'if(a.WH_NO!=b.WH_NO)SELECT a.PRODUCT_NO,b.PRODUCT_NAME,a.QTY_IN,a.UNIT_COST FROM STOCKDETAILS a, STOCKDETAILS b WHERE a.PRODUCT_NO=b.PRODUCT_NO and a.WH_NO='WH1' AND a.STOCK_JR='IN' AND b.STOCK_JR='OU'i want these queries execute at single result set 解决方案 这篇关于if条件为sql查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-18 10:21