Getting the number of rows with a GROUP BY query

后端 未结 5 1161

I have a query to the effect of

SELECT t3.id, a,bunch,of,other,stuff FROM t1, t2, t3 
WHERE (associate t1,t2, and t3 with each other) 
GROUP BY t3.id 
LIMIT          


        
5条回答
  •  心在旅途
    2020-12-12 16:49

    Using sub queries :

    SELECT COUNT(*) FROM    
    (
    SELECT t3.id, a,bunch,of,other,stuff FROM t1, t2, t3 
    WHERE (associate t1,t2, and t3 with each other) 
    GROUP BY t3.id 
    )    
    as temp;
    

    so temp contains the count of rows.

提交回复
热议问题