Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tricky SQL question
Message
From
24/09/2001 00:47:13
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
24/09/2001 00:32:13
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00559844
Message ID:
00559847
Views:
13
Robert,

If any of the Qty items will do, then either the MAX() or the MIN() Qty will meet your criteria.
SELECT Item, MIN(Qty) FROM MyTable GROUP BY Item
>Hi All,
>
>I have a table containing two fields, Item and Qty. Neither field is uniue. I need to select the distinct list of items from the table, and any one of the 'associated quantities'. Eg:
>
>Item Qty
>A 2
>A 4
>A 6
>B 3
>C 7
>C 9
>
>Results I want are:
>
>A 2 (or 4 or 6)
>B 3
>C 7 (or 9)
>
>Thanks,
>Rob
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform