Linked Questions

1 vote
3 answers
16k views

Possible Duplicate: Function to Calculate Median in Sql Server I have a table like this: SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[cars]( [id]...
jrara's user avatar
  • 17.1k
1 vote
1 answer
23k views

I have this query ;WITH cte AS ( SELECT *, DATEPART(WEEKDAY, Dt) AS WeekDay, PERCENTILE_CONT(0.75) WITHIN GROUP (ORDER BY SaleCount) OVER (PARTITION BY CustomerType, [...
psysky's user avatar
  • 3,205
0 votes
3 answers
2k views

Possible Duplicate: Function to Calculate Median in Sql Server I have a table containing two field (more, but not relevant). The fields are Price and Quantity. I want to find several statistically ...
rozon's user avatar
  • 2,558
0 votes
1 answer
344 views

I have a number of select statements which calculate fields such as sums, division and also averages. However I am now needing to include a median based on the query, as well as a mean(avg). The table ...
Processit's user avatar
0 votes
1 answer
308 views

Query SELECT SpaID, COUNT(1) AS Total FROM dbo.[Order] (nolock) WHERE DateCreated BETWEEN '04-01-2014' AND '04-30-2014' GROUP BY SpaID I need to find the median amount in the new column named "...
John Williams's user avatar
0 votes
2 answers
272 views

Kindly help with the following T-SQL query. The data used is that of us_counties_2010. SELECT SUM(P0010001) AS 'County Sum', ROUND(AVG(P0010001),0) AS 'County Average', PERCENTILE_CONT(0....
SAAD's user avatar
  • 1
0 votes
0 answers
216 views

I have this as my Average Statement and am wanting to get the Median Value: select AVG (DATEDIFF("m", dlg_applicationreceived, dlg_dateofdecision)) as TimetakenAVG, format(dlg_dateofdecision, 'MMM-yy'...
Rae G's user avatar
  • 1
0 votes
0 answers
118 views

Hi I have a table facility that holds a score for each day (Multiple scores can be reported each day and both would be valid) I need to calculate the Mode and Median score by month. Facility: Id ...
Agga's user avatar
  • 335
0 votes
1 answer
124 views

Possible Duplicate: Function to Calculate Median in Sql Server Goal: Display the value of the median based on this code below. Problem: I don't how to do display it in SQL server The table can ...
HelloWorld1's user avatar
  • 14.2k
-1 votes
1 answer
89 views

Please assist me, I need to pick 790 since its in middle but not able to figure it out. id Value 12 780 123 796 124 790 Thank you in advance
user2711165's user avatar
0 votes
0 answers
33 views

I have a Data Set as below and need to calculate median for that set. Below Data Set is a growing Data set. Just display only the first 2 Ids. Need to display it as group by with ID,Month and Section ...
KH19's user avatar
  • 23
275 votes
51 answers
424k views

What's the simplest (and hopefully not too slow) way to calculate the median with MySQL? I've used AVG(x) for finding the mean, but I'm having a hard time finding a simple way of calculating the ...
davr's user avatar
  • 19.2k
6 votes
5 answers
16k views

For even rows, the formula for median is (104.5 + 108)/2 for the table below and for odd rows it is 108 for table below: Total Total 100 100 101 101 104.5 104.5 108 ...
user680865's user avatar
13 votes
3 answers
28k views

I am working with SQL Server 2008 If I have a Table as such: Code Value ----------------------- 4 240 4 299 4 210 2 NULL 2 3 6 30 6 80 6 10 4 240 2 ...
Stu Harper's user avatar
6 votes
1 answer
19k views

Below is the schema for the athena table I wish to calculate median for 'parameter_value' group by standard_lab_parameter_name & units. For this I followed link : https://docs.aws.amazon.com/...
Mehul Gupta's user avatar
  • 1,939

15 30 50 per page