Hi there,
I have the following code:
I need to calculate a median on datediffcal column, but not sure how should the syntax goes.
It doesn't matter if the result shows only a median. For example, if it just shows:
median
15
that's fine. I just need to learn how the median calculation is done in T-SQL.
Any ideas?
I have the following code:
Code:
Select gender, CASE when gender = 'F' then 'Female' when gender = 'M' then 'Male' else 'Unknown' end as test, datediff(day, [tbl_record], getdate()) as 'datediffcal', from [tbl_record]
It doesn't matter if the result shows only a median. For example, if it just shows:
median
15
that's fine. I just need to learn how the median calculation is done in T-SQL.
Any ideas?
Comment