[thelist] Version Strategy (ASP)

Rob Smith rob.smith at THERMON.com
Wed Jan 7 13:16:36 CST 2004


Yes. And your query is a sub query <em>after</em> I know all the distinct
items in the table. I was thinking something like:

SELECT ItemID, ItemName, Version FROM [table] WHERE Version = (SELECT
MAX(Version)) 
...but that didn't work.

Rob


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



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

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


More information about the thelist mailing list