[thelist] Version Strategy (ASP)

David Mitchell dave at dbmdata.com
Wed Jan 7 13:13:53 CST 2004

Are these fields from a database?
If so what about?: SELECT MAX(Version) from [table] WHERE Item Name =
['ABC'], etc.

-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Rob Smith
Sent: Wednesday, January 07, 2004 2:04 PM
To: Thelist (E-mail)
Subject: [thelist] Version Strategy (ASP)

Hi Listeroo's:

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

What I want as a returned record set is

ItemID	Item Name	Version
7		ABC		4
9		DEF		3
6		GHI		2

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.  * *

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt ! 

More information about the thelist mailing list