I am trying to get two counts and divide them in Oracle 11g ... I tried two versions of it
1)
SELECT
x.number/y.number
FROM
(
SELECT
COUNT(*) as "number"
FROM
GAME
WHERE
HOMETEAM='Blackpool'
AND FTR='H'
OR AWAYTEAM='Blackpool'
AND FTR='A'
) x
join (
SELECT COUNT(*) as "number"
FROM GAME
WHERE HOMETEAM='Blackpool'
OR AWAYTEAM='Blackpool'
)y;
I get the below error
ORA-01747: invalid user.table.column, table.column, or column specification 01747. 00000 - "invalid user.table.column, table.column, or column specification"
*Cause:
*Action: Error at Line: 1 Column: 10
2)
select
(
SELECT COUNT(*)
FROM GAME
WHERE HOMETEAM='Blackpool'
AND FTR='H'
OR AWAYTEAM='Blackpool'
AND FTR='A'
) /
(
SELECT COUNT(*)
FROM GAME
WHERE HOMETEAM='Blackpool'
OR AWAYTEAM='Blackpool'
);
After I run this one ..I get the below error
ORA-00923: FROM keyword not found where expected 00923. 00000 - "FROM keyword not found where expected" *Cause:
*Action: Error at Line: 3 Column: 84
WHERE (HOMETEAM='Blackpool' AND FTR='H') OR (AWAYTEAM='Blackpool' AND FTR='A'). - Thorsten Kettner