sql - Query Performance tuning - Searching for other options -


I need to know that there is another way to query this.

Table This structure is:

  EXAM_DATE DATE VARCHAR2 (50); Grade number;   

To obtain statistics from the perception examination. Choose

  EXAM_DATE, SUBJECT (SELECT COUNT (1) from EXAMS where grades (9 .10)) and yield = EXA.SUBJECT and EXAM_DATE = EXA.EXAM_DATE), (EXAM_DATE = EXA. EXAM_DATE) (4,5,6,7,8) in grading and yield = Selection number (1)) from EXA.SUBJECT and EXAMS, (counting from examination (1) where in Grade (0,1,2, 3) and subject = EXA.SUBJECT and EXAM_DATE = EXA.EXAM_DATE) Disclaimed, EXAM from EXA Group, subject to EXAM_DATE;   

Thanks!

Just use conditional aggregation No need for subkey:

 < Choose the code> EXAM_DATE, SUBJECT, SUM (in grades (9 .10) then 1 ELSE 0 END) as outstanding, SUM (grade 4,5,6,7, 8) then the form of 1 ELSE 0nd) Approved in, SUM (Grade In (0,1,2,3) THEN 1 ELSE 0 END) as EXEM_DATE, EXAM_DATE by EXA Group, EXAM;    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -