mysql - how to delete from one table where count less than? -


i have 2 tables.

i use query find number of occurences of field 1 table in table

select t.id, t.tag_text, count(*) cnt sms s, template t s.id_template=t.id group  t.tag_text order  cnt desc 

how can delete rows template if occure in sms less 5 times example? mean if count less 5. use mysql.

delete template     id in         (             select      id_template                    sms             group    id_template             having      count(*) < 5          ) 

Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -