标签:ted 重复 str select 记录 ble diff now() min
select * from table where id in (select min(id) from table where 1 = 1 and isused=0 and datediff(hh,addtime,‘"&now()&"‘)<168 group by openid)
解释:从数据表table当中列出openid字段不重复、未被使用过的、添加时间到现在未超过7天(168小时)的所有列的记录。
标签:ted 重复 str select 记录 ble diff now() min
原文地址:https://www.cnblogs.com/zengkun983/p/10262295.html