第11行的SQL CASE语句错误

时间:2018-06-28 11:27:53

标签: sql

我已尽一切努力纠正CASE语句,但它继续   错误。   我需要加入三个表,分别是student_demo,course和student_enroll。

以下是查询:

`SELECT
  sd.other_name,
  sd.first_name,
  sd.last_name,
  sd.email_address,
  sd.citizenship_code,
  sd.title,
  sd.passport_no,
  sd.alt_student_id,
  sd.district_id,
  se.school_id 

  CASE WHEN sd.other_name is null THEN 'Federated ID'
  WHEN sd.title is null THEN 'conestagevalley.org' 
  WHEN sd.passport_no is null THEN 'Default Spark with Premium Features for K-12 - 2 GB configuration' 
  WHEN sd.alt_student_id is null THEN 'Tech Students Creative Cloud Licensed' 
  WHEN sd.citizenship_code = 'US' THEN 'US'
  ELSE 'not US' END AS citizenship_code
  FROM
  student demo sd
  INNER JOIN school_id se ON se.district_id = 'CVSD'
  WHERE

  cr.department_code = 'TECED'`

任何帮助将不胜感激。

0 个答案:

没有答案