|
-
Jan 5th, 2011, 02:44 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] SQL and top 20 items in a table
I have an inventory cycle count file which may contain several thousand records. I am trying to get the TOP 20 items (based on qty_adjusted value) and return only those to a dataset.
I am trying to use the TOP 20 statement but am getting an Invalid Token error at execution time.
SELECT TOP 20 di3.Qty_A00001 +
FROM Dobsojm1.Item_00003 di3 +
JOIN Dobsojm1.ITEM_00001 di1 +
ON di3.ITEM_00001 = di1.ITEM_00001 +
ORDER BY di3.Qty_A00001 DESC"
Also tried
SELECT * +
FROM Dobsojm1.Item_00003 di3 +
JOIN Dobsojm1.ITEM_00001 di1 +
ON di3.ITEM_00001 = di1.ITEM_00001 +
ORDER BY di3.Qty_A00001 DESC LIMIT 20"
Neither works... Where am I going wrong here.... Oh .... also there may be duplicated "high" adjustments so I need to figure those into the top 20.
thank you
gollnick
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|