主席先生,Expression Web中的以下声明适用于第一个标准
SELECT COUNT(Rly) AS CR FROM SPAD WHERE Rly='CR'
。
现在的问题是,如果同一列中需要多个条件,例如Count(Rly) AS ER FROM SPAD WHERE Rly='ER'
需要什么声明? 请帮忙。
答案 0 :(得分:1)
计算两个值:
SELECT COUNT(Rly) AS TheCount FROM SPAD WHERE Rly IN ('CR', 'ER')
一次性分开计算:
SELECT COUNT(Rly) AS TheCount, Rly
FROM SPAD
WHERE Rly IN ('CR', 'ER')
GROUP BY Rly