sql - MySQL having if -



sql - MySQL having if -

i'm having problem mysql query. if label "5" want records there more 10 of them current day, number of rows other labels. best way accomplish in query?

select id,name,label,date items grouping date('date'), label having count(id) > 10 if label = 5

i in single query:

select id, name, label, date items date >= date(now()) , date < date(now()) + interval 1 day grouping label having (count(id) > 10 , label = 5) or (label <> 5);

this seems simplest method.

mysql sql having having-clause

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -