我有这个查询
select date(fecha) as day, min(num) as mi
from myTable
where date(fecha) >= date(now())
group by day;
我如何在mi < 10
类似于
select date(fecha) as day, min(num) as mi
from myTable
where date(fecha) >= date(now())
and mi < 10
group by day;
答案 0 :(得分:7)
使用“拥有”声明
select date(fecha) as day, min(num) as mi
from myTable where date(fecha) >= date(now())
group by day
having min(num) < 10;
答案 1 :(得分:0)
也许这......
select date(fecha) as day, min(num) as mi
from myTable
where date(fecha) >= date(now())
and num < 10
group by day;