Viewing 11 posts - 1 through 11 (of 11 total)
I took a different approach and restructured my data so that I didn't need to do this. The with/as row_number()/partition worked beautifully and did exactly what I wanted and...
March 5, 2009 at 7:43 am
steveb (3/3/2009)
is there...
March 3, 2009 at 12:15 pm
steveb (3/3/2009)
No, this query will return all the distinct rows in your table where the level is the highest for each entry_Id and group_id
Ok, perhaps my sample data wasn't...
March 3, 2009 at 11:06 am
GilaMonster (3/3/2009)
Yes there is. The 2000 forums are below the 2005 forums on the forum home page.
Sorry! When I was scanning the list I didn't notice the...
March 3, 2009 at 10:57 am
steveb (3/3/2009)
Thanks, this code should work orderd by Level
SELECT * FROM YourTable WHERE LEVEL IN(
SELECT MAX(LEVEL) AS LEVEL
FROM YouTable
GROUP BY [entry_id], [group_id])
That will only ever...
March 3, 2009 at 10:48 am
Yeah, there was no forum for Sql server 2000.
I'm going to go cry now 😉
March 3, 2009 at 10:45 am
Mark: the row_number() over partition looks like it's working!!
Please tell me that is Sql Server 2000 compliant 🙂 (my test machine is Sql 2005 Express)
March 3, 2009 at 10:14 am
Steveb: I already added another post with a column called level.
March 3, 2009 at 10:13 am
Lee: Thanks, that looks neat but I shudder while thinking how it would apply for non-trivial result sets. That looks like a lot of work for a...
March 3, 2009 at 9:56 am
Ok, let's assume there is another column:
entry_id,group_id,cost,level
1001 2001 5 7
1001 2001 ...
March 3, 2009 at 9:54 am
Yes, the results are returned in such an order that the first result is the one that I want to keep, any subsequent results with the same values across those...
March 3, 2009 at 9:37 am
Viewing 11 posts - 1 through 11 (of 11 total)