SQL 2005 的CASE用法

select Student.StudentId,StudentName,ClassId,(select ClassName from Class where Class.ClassId=Student.ClassId) ClassName,
CASE
 when StudentToCourse.CourseId is  NULL 
  then '未修'
 ELSE '已修' end  选课状态
from  Student
left join StudentToCourse on Student.StudentId=StudentToCourse.StudentId where Student.ClassId='2003050111'

-------------------------------------------------这下大家满足了吧----------------------------------------------------------------------
Permalink | Comments (0) | Hits: 633 | Time: 11:09:38
时间为空则为-,不为空则显示时间
SQL2005附加数据库是只读怎么办?
All Comments

 No Data Now...

Post Your Comment
^ ^

2460
Top
Display Pagerank