![]() |
style stat mod?
So I am a noob at mysql queries, is there an easy way to establish which style users are using? I'd like output along the lines of:
style01 283 users style02 281 users style03 193 users ... I tried search, but as always, if not quite sure what one is looking for the hits are overwhelmingly irrelevant. |
Not tested:
[sql]SELECT styleid, COUNT(*) FROM user GROUP BY styleid[/sql] |
Thanks, worked like a charm. ;)
Now I just need to associate returned IDs with the names of the styles. I assume that 0 is the default one. |
[sql]SELECT user.styleid, style.title, IF(user.styleid = 0, "Using Default Style", style.title), COUNT(*) AS Count
FROM user AS user LEFT JOIN style AS style ON (style.styleid = user.styleid) GROUP BY user.styleid ORDER BY Count DESC[/sql] |
You are a scholar and a gentleman.
Thanks! |
All times are GMT. The time now is 07:32 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|