标签:
MySQL中模糊查询
SELECT * FROM 表名 WHERE (字段1 <> "" 字段2 <> "") and (字段3 LIKE ‘%参数%‘ OR 字段4 LIKE ‘%参数%‘)
查询统计今天注册的用户总数
Select COUNT(UM_NAME) FROM user_manager WHERE to_days(UM_CREATETIME) = to_days(now())
查询实名通过数量(包括个人用户和企业用户)、被冻结用户数量
SELECT UM_TYPE,COUNT(UM_TYPE) countUmType
FROM user_manager
GROUP BY UM_TYPE
HAVING UM_TYPE=1 OR UM_TYPE=4 OR UM_TYPE=5 OR UM_TYPE=6
查询今日投资用户总数
select COUNT(DISTINCT USER_ID) countUmNumber
FROM investment_project
where to_days(IP_CREATETIME) = to_days(now())
根据日期区间查询
select 列名 from 表名 WHERE DATE_FORMAT(列名, ‘%Y-%m-%d‘) >=‘2016-05-09‘ AND DATE_FORMAT(列名, ‘%Y-%m-%d‘) <=‘2016-05-10‘
标签:
原文地址:http://www.cnblogs.com/xzp0222/p/5515039.html