新年快乐每个人!!!
我的目标是编写一个查询以返回结果ACTIVE OR INACTIVE。 这就是我到目前为止所做的。有谁知道如何正确编写此查询?
SELECT COUNT (*) AS Active FROM ADF_Course
WHERE CourseActive=1 OR CourseActive='y'
ELSE IF CourseActive=n
THEN CourseActive IS Inactive
答案 0 :(得分:0)
SELECT
case when CourseActive='1' OR CourseActive='y'
then 'Active' else 'Inactive' end AS Active, count(*)
FROM ADF_Course
group by
case when CourseActive='1' OR CourseActive='y'
then 'Active' else 'Inactive' end