gfody
asked on
user defined aggregate function
I need to make my own aggregate function. I'm running sql server 2000, can someone give me an example of how to do this.
btw, this is what I'm trying to do:
given a list of numeric values ie (1,2,2,1,0,2) I need to return 0 if 0 occurs before 1, or 1 if 1 occurs before 0
btw, this is what I'm trying to do:
given a list of numeric values ie (1,2,2,1,0,2) I need to return 0 if 0 occurs before 1, or 1 if 1 occurs before 0
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have a very complicated set of tables for permissions based on the nested sets model. The routine for processing your permission records to determine whether or not you have access to something is a function that reads in all the permission records on your tree and recursively collapses them. I could do it all in sql if I could define an aggregate like the one in my first post.
Writing custom aggregate function will be possible with SQL Server 2005 (Yukon)
If you need more support, please post more details on what you want, the queries you already have, and we'll see what can be done
Hilaire