Home > database >  Trouble your bosses. Oracle query, have been reported missing right parenthesis
Trouble your bosses. Oracle query, have been reported missing right parenthesis

Time:10-29

Query all class the highest scores, higher grades (higher scores must be less than the highest score), the highest scores, test2_06 has four columns: course number cid, course name name, highest grade max_score, higher grade max_score2, top grade number max_score_count (a student the same course grades are the first, one meter only), if there is no students' course selection, the highest scores for null values, the highest grade number is zero, if there is no higher grades, the second-highest score for null values,








The create view test2_06 as select
A.c id, a.n ame, max_score max_score2, max_score_count from (select cid, the name from the pub. The score). A,
(select cid, Max (score) max_score from pub. Student_course group by cid) b,
(select 2. Cid, Max (1 score) max_score2 from pub. Student_score 1, pub. Student_score 2 where 2. Cid=1. Cid and 2 score<1. The score group by 2. Cid) c,
(select sc. Cid, count (distinct sid) from the pub. Student_course sc,
(select cid, Max (score) max_score from pub. Student_course group by cid) max_sc where sc. Cid=max_sc. Cid and sc. Score=max_sc. Score) group by sc. Cid) d
Where a.c id=biggest id
And biggest id=Arthur c. id
And Arthur c. id=, dc id

CodePudding user response:

 create view test2_06 as select 
A.c id, a.n ame, max_score max_score2, max_score_count from (select cid, the name from the pub. The score). A,
(select cid, Max (score) max_score from pub. Student_course group by cid) b,
(select biggest id, Max (a.s core) max_score2 from pub. Student_score a, pub. Student_score b where biggest id=a.c id and b.s core(select sc. Cid, count (distinct sid) from the pub. Student_course sc,
(select cid, Max (score) max_score from pub. Student_course group by cid) max_sc where sc. Cid=max_sc. Cid and sc. Score=max_sc. Score group by sc. Cid) d
Where a.c id=biggest id
And biggest id=Arthur c. id
And Arthur c. id=, dc id

CodePudding user response:

The
reference 1/f, February 16 response:
 create view test2_06 as select 
A.c id, a.n ame, max_score max_score2, max_score_count from (select cid, the name from the pub. The score). A,
(select cid, Max (score) max_score from pub. Student_course group by cid) b,
(select biggest id, Max (a.s core) max_score2 from pub. Student_score a, pub. Student_score b where biggest id=a.c id and b.s core(select sc. Cid, count (distinct sid) from the pub. Student_course sc,
(select cid, Max (score) max_score from pub. Student_course group by cid) max_sc where sc. Cid=max_sc. Cid and sc. Score=max_sc. Score group by sc. Cid) d
Where a.c id=biggest id
And biggest id=Arthur c. id
And Arthur c. id=, dc id

Do you have what difference

CodePudding user response:

refer to the second floor qq_32205311 response:
Quote: reference 1/f, February 16 response:
 create view test2_06 as select 
A.c id, a.n ame, max_score max_score2, max_score_count from (select cid, the name from the pub. The score). A,
(select cid, Max (score) max_score from pub. Student_course group by cid) b,
(select biggest id, Max (a.s core) max_score2 from pub. Student_score a, pub. Student_score b where biggest id=a.c id and b.s core(select sc. Cid, count (distinct sid) from the pub. Student_course sc,
(select cid, Max (score) max_score from pub. Student_course group by cid) max_sc where sc. Cid=max_sc. Cid and sc. Score=max_sc. Score group by sc. Cid) d
Where a.c id=biggest id
And biggest id=Arthur c. id
And Arthur c. id=, dc id

Do you have what difference?
to change the position of a few braces

CodePudding user response:

The
reference 1/f, February 16 response:
 create view test2_06 as select 
A.c id, a.n ame, max_score max_score2, max_score_count from (select cid, the name from the pub. The score). A,
(select cid, Max (score) max_score from pub. Student_course group by cid) b,
(select biggest id, Max (a.s core) max_score2 from pub. Student_score a, pub. Student_score b where biggest id=a.c id and b.s core(select sc. Cid, count (distinct sid) from the pub. Student_course sc,
(select cid, Max (score) max_score from pub. Student_course group by cid) max_sc where sc. Cid=max_sc. Cid and sc. Score=max_sc. Score group by sc. Cid) d
Where a.c id=biggest id
And biggest id=Arthur c. id
And Arthur c. id=, dc id

I see no change, trouble, himself a novice

CodePudding user response:

reference 4 floor qq_32205311 response:
Quote: reference 1/f, February 16 response:
 create view test2_06 as select 
A.c id, a.n ame, max_score max_score2, max_score_count from (select cid, the name from the pub. The score). A,
(select cid, Max (score) max_score from pub. Student_course group by cid) b,
(select biggest id, Max (a.s core) max_score2 from pub. Student_score a, pub. Student_score b where biggest id=a.c id and b.s core(select sc. Cid, count (distinct sid) from the pub. Student_course sc,
(select cid, Max (score) max_score from pub. Student_course group by cid) max_sc where sc. Cid=max_sc. Cid and sc. Score=max_sc. Score group by sc. Cid) d
Where a.c id=biggest id
And biggest id=Arthur c. id
And Arthur c. id=, dc id

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related