Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I am getting a syntax error on the code below. I wish to substitute the report text for each column clarifying the its meaning.

SELECT CONCAT(LastName, ', ', FirstName) AS "System Administrator", 
  studentcourse.CourseID AS "Certification"
  SELECT CASE
    WHEN studentcourse.CourseID='Pending_CCSA_DCMA' THEN 'Pending CCSA Completion'
    WHEN studentcourse.CourseID='Pending_CCSE_DCMA' THEN 'Pending CCSE Completion'
    WHEN studentcourse.CourseID='P_CA_eHealth_DCMA' THEN 'CA eHealth Administrator'
    WHEN studentcourse.CourseID='P_CCSE_DCMA' THEN 'Checkpoint Security Engineer'
    WHEN studentcourse.CourseID='P_CCSA_DCMA' THEN 'Checkpoint Security Administrator'
    WHEN studentcourse.CourseID='P_LRCP_DCMA' THEN 'LogRhythm Certified Professional'
    END AS 'studentcourse.CourseID'
FROM studentcourse, student
where student.studentID=studentcourse.StudentID 
  and Student.IsActiveFlag='1' 
  and student.SubOrg5='Yes' 
  and 
  (studentcourse.CourseID='Pending_CCSA_DCMA'
    or studentcourse.CourseID='Pending_CCSE_DCMA'
    or studentcourse.CourseID='P_CA_eHealth_DCMA'
    or studentcourse.CourseID='P_CCSE_DCMA'
    or studentcourse.CourseID='P_CCSA_DCMA'
    or studentcourse.CourseID='P_LRCP_DCMA')
Order by LastName

Any assistance would be appreciated.

share|improve this question
    
Change the SELECT CASE to CASE. –  ypercube Nov 8 '13 at 16:25
3  
You are missing a comma after studentcourse.CourseID AS "Certification" –  bluefeet Nov 8 '13 at 16:26
1  
@bluefeet You're an excellent human parser –  Phil Nov 9 '13 at 1:19
    
Just a little more tweeking to make it perfect. I should have caught the missing ','. Thank you! –  Deborah Ballen Nov 12 '13 at 14:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.