This is my script
SELECT COUNT( [Id]) as [Count Of Register],
Tag as [Tag]
FROM [Members]
Group By Tag
Order By [Count Of Register] Desc;
Returned table is like this:
Count Tag
550 ----1
550 ----2
545 ----3
545 ----4
545 ----5
So, this time I need Count of Tag, Group by this new Count field.
Some Returned Values Like:
2 ---550
3 ---545
Is there any way without using new table or Template Table or any Storage Table just by query?
You could use
mysql> create table order1(counter int(3) not null auto_increment primary key, -> tag int(3)); Query OK, 0 rows affected (0.01 sec)
mysql> insert into order1 values(500,20);//insert somany values as u required and check insert into order1 values(500,20); insert into order1 values(600,20); mysql> select counter,count(*) from order1 group by counter