Skip to main content

Timeline for Select row at the nth percentile

Current License: CC BY-SA 3.0

11 events
when toggle format what by license comment
May 23, 2017 at 12:40 history edited CommunityBot
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Dec 15, 2014 at 5:55 vote accept D3XT3R
Dec 24, 2013 at 15:21 comment added Erwin Brandstetter @D3XT3R: Use a descending order and add LIMIT 1 to get the last row in a simple query.. SELECT * FROM .. ORDER BY ans DESC LIMIT 1. Or, in the above query, to pick the row with the highest value from the segment, add DESC at the very end. You would pick the segments (600, 900, 990, 1000) in this case and adapt the to_char() expression accordingly.
Dec 24, 2013 at 15:04 comment added D3XT3R thanks erwin..how can i get the last row of the table i.e. the 100 percentile value? should i divide the rows into further more segments?
Dec 24, 2013 at 15:00 comment added Erwin Brandstetter Since I divided the rows into 1000 segments, the lowest value of the 601st (or the highest value of the 600th) would mark the 60% border ...
Dec 24, 2013 at 14:56 comment added D3XT3R so how do you base your selection of segments..i mean lets say.. i want to display percentile value of 100 percentile within the same algorith. as per your algorithm, i need to provide the segments of data i want to create, am i on the correct track?
Dec 24, 2013 at 14:52 comment added Erwin Brandstetter @D3XT3R: Actually my selection of segments was off. I fixed that and added the row above 60%.
Dec 24, 2013 at 14:51 history edited Erwin Brandstetter CC BY-SA 3.0
fix selection of segments and value for percentile
Dec 24, 2013 at 14:29 history edited Erwin Brandstetter CC BY-SA 3.0
added 261 characters in body
Dec 24, 2013 at 14:20 history edited Erwin Brandstetter CC BY-SA 3.0
added 36 characters in body
Dec 24, 2013 at 14:13 history answered Erwin Brandstetter CC BY-SA 3.0