michaelkrauklis
Programmer
Is there any way to create a funciton or stored procedure that can take a result set and return the median? Eg:
The main problem is passing a result set to a function or stored procedure. Is this possible? For efficiency purposes I can't pull the data out and then calculate the median, and I'd rather not do the query multiple times and use a cursor to pull out the medians for each grouping. Any help will be greatly appreciated.
MYenigmaSELF:-9
myenigmaself@myenigmaself.gaiden.com
"If debugging is the process of removing bugs, then programming must be the process of putting them in." --Dykstra
Code:
select company, MEDIAN(salary)
from jobs
group by company
MYenigmaSELF:-9
myenigmaself@myenigmaself.gaiden.com
"If debugging is the process of removing bugs, then programming must be the process of putting them in." --Dykstra