Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
1 vote
1 answer
86 views

I am making calculations in the database and want to validate results against Pandas' calculations. I want to calculate the 25th, 50th and 75th percentile. The end use is a statistical calculation so ...
0 votes
1 answer
249 views

I am searching for a solution for a problem. I am working with Amazon Athena and i need a field that shows the percentile of days for a product between 2 timestamps. I have it working in Amazon ...
0 votes
1 answer
31 views

So i'm having trouble with calculating medians in T-SQL properly. I've got a CTE that looks like this: Medians AS ( SELECT ParishCode AS PAR21CD, ChangeDate AS 'Month Start', ...
1 vote
2 answers
1k views

I'm using SQL Server 2012 and trying to calculate some aggregate functions and percentiles on a data set with two columns (id and time). In my research I found some solutions, but they don't work for ...
0 votes
1 answer
1k views

I have a table named TabA with the following columns, Id Currency Value Institution Expected Results: Id Currency Cnt Median(Value) Institution I am getting the values except Median(Value) ...
0 votes
1 answer
97 views

I want to create a ntile(3) within an ntile(3). I have the following table: Customer Total_amt Digital_amt 1 100 45 2 200 150 3 150 23 4 300 100 5 350 350 6 112 10 7 312 15 8 260 160 9 232 150 10 190 ...
0 votes
0 answers
279 views

I have a large SQL table with 100+ million records in SQL Server as follows: +-----------+----------+----------+----------+----------+ |CustomerID |TransDate |Category | Num_Trans |Sum_Trans | +-------...
-1 votes
3 answers
481 views

I need to calculate the median transaction amount for each customer in the past 52 weeks, but percentile_cont returns NULL if there's no transaction for a particular customer. In such a case, I have ...
1 vote
1 answer
741 views

I am computing a range of values in PostgreSQL, and I want to round some of them to 2 decimal places. when I do round the average it works round(avg(rate), 2) as avg_rate. when I round the median ...
gjc's user avatar
  • 39
2 votes
1 answer
2k views

I was wondering if there is a way to find the 'median' date in PostgreSQL. The goal is to obtain, according to the median, the date that is in the middle of all the dates. I tried following modified ...
1 vote
0 answers
352 views

This SO question describes how to call DatePart function using EntityFramework: I wonder if I can provide a similar binding for PERCENTILE_CONT. Or maybe the only way to use PERCENTILE_CONT via ...
1 vote
0 answers
661 views

I found the following query in a book on T-SQL SELECT round(SUM(TotalDue),1) AS Sales, LastName, FirstName, SalesPersonId, AccountNumber, PERCENTILE_CONT(0.4) WITHIN GROUP (ORDER BY round(SUM(...
0 votes
1 answer
295 views

I have a column with numbers. I already calculated the percentiles using percentile_cont. How can I sum up/count all the rows (& calculate their %) that fall below, e.g. the 25th percentile?
0 votes
1 answer
452 views

I have a data set Cashback table user | order_amount -------+------------ raj | 200 rahul | 400 sameer | 244 amit | 654 arif | 563 raj | 245 rahul | 453 amit | 534 arif | 634 raj |...
user avatar
0 votes
1 answer
1k views

I am trying to run a SQL query to find a 50th percentile in a table within a certain group, but then i am also grouping the result over the same field. Here is my query, for example over the tpch's ...

15 30 50 per page
1
2

AltStyle によって変換されたページ (->オリジナル) /