SQL 的 or注意事项 要正确使用括号
select c_gcode,c_barcode,c_name,c_price_disc,c_price,c_status from tb_gds where ( c_price like '%._[1,2,3,4,5,6,7,8,9]%' or c_price_disc like '%._[1,2,3,4,5,6,7,8,9]%' )and c_weigh='否' and c_status='正常流转' order by c_price_disc desc select c_gcode,c_barcode,c_name,c_price_disc,c_price,c_status from tb_gds where c_price like '%._[1,2,3,4,5,6,7,8,9]%' or c_price_disc like '%._[1,2,3,4,5,6,7,8,9]%' and c_weigh='否' and c_status='正常流转' order by c_price_disc desc
结果肯定是不一样的。
本文来自博客园,作者:忙碌在路上,转载请注明原文链接:https://www.cnblogs.com/netsa/archive/2012/12/12/2814065.html