Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
649 views
in Technique[技术] by (71.8m points)

sql - Error (ORA-00923: FROM keyword not found where expected)

    select 
      country_olympic_name, 
      SUM(part_gold) as 'Number of Gold Medals'
    From
      games.country,
      games.participation
   where
      participation.country_isocode = country.country_isocode
   group by
      country_olympic_name;

I have been getting the error ORA-00923: FROM keyword not found where expected and do not know why, please help

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Identifiers need to be quoted with double quotes ("). Single quotes (') denote a character value (not a "name").

Therefor you need to use:

SUM(part_gold) as "Number of Gold Medals"

More details in the manual:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...