Dear Tom,
I tried to run this query, following example here
https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions150.htm: SELECT AVG(DECODE(cust_gender, 'M', 1, 0)) real_proportion,
STATS_BINOMIAL_TEST
(cust_gender, 'M', 0.68, 'EXACT_PROB') exact,
STATS_BINOMIAL_TEST
(cust_gender, 'M', 0.68, 'ONE_SIDED_PROB_OR_LESS') prob_or_less
FROM sh.customers;
But unfortunately, it returned an error:
ORA-01760: illegal argument for function
01760. 00000 - "illegal argument for function"
*Cause:
*Action:
After that, I brought the query into a procedure and ran it again but an error was the same.
I have no idea why I could not run. Could you help me with this?
Thank you so much.
Sorry I can't reproduce...
SQL> SELECT AVG(DECODE(cust_gender, 'M', 1, 0)) real_proportion,
2 STATS_BINOMIAL_TEST
3 (cust_gender, 'M', 0.68, 'EXACT_PROB') exact,
4 STATS_BINOMIAL_TEST
5 (cust_gender, 'M', 0.68, 'ONE_SIDED_PROB_OR_LESS') prob_or_less
6 FROM sh.customers;
REAL_PROPORTION EXACT PROB_OR_LESS
--------------- ---------- ------------
.66981982 6.6181E-09 1.3981E-07
SQL> select banner from v$version;
BANNER
-------------------------------------------------------------------------
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production