The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
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. |
#2
|
|||
|
|||
Not tested:
[sql]SELECT styleid, COUNT(*) FROM user GROUP BY styleid[/sql] |
#3
|
||||
|
||||
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. |
#4
|
|||
|
|||
[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] |
#5
|
||||
|
||||
You are a scholar and a gentleman.
Thanks! |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|