Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm attempting to replicate the functionality of an Excel workbook in Oracle. One of the formulae on the worksheet uses CHIDIST, which "Returns the one-tailed probability of the chi-squared distribution". I can't see a similar function in Oracle anywhere! Am I going to have to write my own CHIDIST function?

Here's a link to Excel's documentation on CHIDIST:

I've already worked out the Chi Square and Degrees of Freedom.


share|improve this question
Could you elaborate on why you need that in a query? Oracle does have some statistical functions, but they're more geared towards actually analyzing datasets. – Mat Jun 11 '13 at 18:00
I need this because I have to replicate one of our clients' Excel sheets which has this calculation in it. The results returned by my Oracle query need to match exactly those in Excel. – user1578653 Jun 12 '13 at 8:06
Some of the functionality in your spreadsheet might not best be replaced by server-side code. From what I can tell from the docs you link to, that function is "static"/"pure" not data-driven, it doesn't appear to be the type of thing you'd expect from the database side. – Mat Jun 12 '13 at 8:36
The data that was originally stored in the Excel sheet is now stored in Oracle. The client wants reports automatically generated from the Oracle data. Our reporting system works by carrying out a query and effectively pasting it into an MS Word document. I think the only way I can get the CHIDIST information is through doing it in the database. I may just have to write a custom PL/SQL function to achieve this... – user1578653 Jun 12 '13 at 9:15
Yes you will need to write your own. PL/SQL compiles to native code in Oracle 11g, so speed will not be an issue. – Gaius Jun 13 '13 at 14:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.