On 4/29/00, Brian  Ingram penned:
>Query:
>
>Select SUM(Quantity) AS TopBooks, BookID
>From OrderItems
>GROUPBY BookID
>ORDER BY TopBooks DESC
>
>
>Here is what i get when i run this query(show below).  All I want is 
>the top 3 books returned.  How can i do this with SQL?
>
>TopBooks       BookID
> 70            15
> 8             3
> 5             4
> 4             1
> 1             21
> 1             18
> 1             13
> 1             10
>
As always, thanks in advance for your help.  This message board has 
saved me numerous times.

<table>
<tr>
<td>Top 3 Books</td>
<td>Book ID</td>
</tr>
<cfoutput query="myQuery" maxrows="3">
<tr>
<td>#TopBooks#</td>
<td>#BookID#</td>
</tr>
</cfoutput>
</table>


Bud Schneehagen - Tropical Web Creations

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
954.721.3452
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to