category table
-----------------------
catid | catname
-------------------------
Deal table
------------------------
dealid | name | catid |
-----------------------
Cement Table
-----------------------
cid | cname | catid
-----------------------
ordertable
---------------------
oid | oname | catid
---------------------
以上三个表使用我想获取catid的总数并使用desc子句的顺序。如何编写sql查询?
the result like this way
catid catcount catname
-----------------------
1 20 xxx
2 19 YYY