码迷,mamicode.com
首页 > 数据库 > 详细

SQL多条件查询

时间:2016-06-08 12:28:40      阅读:212      评论:0      收藏:0      [点我收藏+]

标签:

SELECT a.tel,a.business_code,b.name AS business_name,a.register_time FROM T_RED_USER a LEFT JOIN T_Product_Spec b ON a.business_code=b.code where a.tel LIKE CONCAT(?,‘%‘) AND (IF(?=‘‘, 1=1, IFNULL(a.business_code,‘‘)=?) OR a.business_code IS NULL ) ORDER BY a.register_time DESC LIMIT ?,?

SQL多条件查询

标签:

原文地址:http://www.cnblogs.com/JAYIT/p/5569342.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!