>It just means the second field in the select statement.
>
>MJS
Oh cool. I've never seen that done before. New trick in the toolbox. :)
Thanks
Will
~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
> I changed it to top 5 and added a little more pizazz. My quesion is,
> why is the order by like that? What is 2? I've only seen it done by
> field names.
It just means the second field in the select statement.
MJS
~|
Intro
>Here's some SQL for MS SQL Server (you're not using Access are you?):
Dude, works like a champ! You rock!
I changed it to top 5 and added a little more pizazz. My quesion is, why is the
order by like that? What is 2? I've only seen it done by field names.
SELECT TOP 5 prodName + ' ' + merch
Here's some SQL for MS SQL Server (you're not using Access are you?):
select top 10 prodName, sum(prodQty) as totalOrdered
from tblOrderItems
group by prodName
order by 2 desc
~|
Introducing the Fusion Authority Quarterly Update.
I'm workin on a query to retrieve top selling items. This is SQL Server. Here's
the pertinent table.
tblOrderItems
---
OrderItemID
prodname
prodqty
What's messin with me is it looks like I need to multiply a COUNT by prodqty.
Here's the SQL I've setup so far. Yes, it's almost t
5 matches
Mail list logo