Mar 17, 2006 #1 metaman Programmer Mar 17, 2006 9 NO I have on table with the following data: Item Qty Pencil 12 Eraser 3 Pencil 5 Pencil 4 Pen 3 Paint 3 Pen 3 I want to list out both Item and Qty but only the rows where the Item is not duplicated. The desired result will be: Pencil 12 Eraser 3 Pen 3 Paint 3
I have on table with the following data: Item Qty Pencil 12 Eraser 3 Pencil 5 Pencil 4 Pen 3 Paint 3 Pen 3 I want to list out both Item and Qty but only the rows where the Item is not duplicated. The desired result will be: Pencil 12 Eraser 3 Pen 3 Paint 3
Mar 17, 2006 #2 PHV MIS Nov 8, 2002 53,708 FR Are you sure uou don't wanted this ? SELECT Item, SUM(Qty) FROM yourTable GROUP BY Item Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886 Upvote 0 Downvote
Are you sure uou don't wanted this ? SELECT Item, SUM(Qty) FROM yourTable GROUP BY Item Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
Mar 17, 2006 Thread starter #3 metaman Programmer Mar 17, 2006 9 NO No this is not what I wanted but thanks for the effort. I want something like: SELECT Item, Qty FROM MyTable WHERE Item = (SELECT DISTINCT Item FROM MyTable) but this does not work Upvote 0 Downvote
No this is not what I wanted but thanks for the effort. I want something like: SELECT Item, Qty FROM MyTable WHERE Item = (SELECT DISTINCT Item FROM MyTable) but this does not work
Mar 17, 2006 #4 PHV MIS Nov 8, 2002 53,708 FR And which Qty field you want ? Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886 Upvote 0 Downvote
And which Qty field you want ? Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
Mar 17, 2006 Thread starter #5 metaman Programmer Mar 17, 2006 9 NO It does not mater which qty field, the first occurance is good enough Upvote 0 Downvote
Mar 17, 2006 #6 PHV MIS Nov 8, 2002 53,708 FR SELECT Item, Min(Qty) FROM yourTable GROUP BY Item Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886 Upvote 0 Downvote
SELECT Item, Min(Qty) FROM yourTable GROUP BY Item Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
Mar 17, 2006 Thread starter #7 metaman Programmer Mar 17, 2006 9 NO This Is just what I wanted thanks a lot, m8 Upvote 0 Downvote