something like this should work.:
<cfquery maxrows="10" etc..>
SELECT user_id,
(SELECT count(*)
FROM uploads ul
WHERE ul.user_id = u.user_id
) AS uploads_made
FROM users u
ORDER BY uploads_made DESC
</cfquery>
-----Original Message-----
From: Greg Creedon [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 21, 2001 3:19 PM
To: CF-Community
Subject: SQL Question
Pretty basic sql question, but, hey, I'm a pretty basic guy!
I have a table of people (people a) and a table of uploads with the
person's id in it (upload b). I'd like to display the top 10, say,
uploaders. What do I use for this??
Thanks for your help! Now, back to Star Trek!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists