[thelist] Version Strategy (ASP)

Edwin Martin edwin at bitstorm.org
Wed Jan 7 13:59:03 CST 2004


Hi Rob Smith,

>What I want as a returned record set is
>
>ItemID  Item Name       Version
>7               ABC             4
>9               DEF             3
>6               GHI             2

Try this:

select max(itemid), itemname, max(version) from objects group by itemname

Where objects is the name of the table.

Edwin Martin



>I'm looking at different strategies for getting the last version of a
>collection of objects and am seeking your advice. Take:
>
>Item ID Item Name       Version
>1               ABC             1
>2               ABC             2
>3               ABC             3
>4               DEF             1
>5               GHI             1
>6               GHI             2
>7               ABC             4
>8               DEF             2
>9               DEF             3
>
>
>The straight forward approach would be to get a list of distinct projects:
>ABC, DEF, GHI. The traverse all items by each name and get the last version
>of each one. My initial thoughts lead me to a multidimensional array, but
>there HAS to be an easier way to do this. (After a long day of coding, I
>tend not to think straight anymore.)
>
>Is there some kind of query that'll do this for me in one move?
>
>Rob Smith
>--
>* * Please support the community that supports you.  * *
>http://evolt.org/help_support_evolt/
>
>For unsubscribe and other options, including the Tip Harvester
>and archives of thelist go to: http://lists.evolt.org
>Workers of the Web, evolt !
--
Surf Edwin Martin's brainwaves: http://www.bitstorm.org/edwin/ 



More information about the thelist mailing list