我有以下计算成员数的查询:distinct count(cst_recno) AS [Member ID],FROM group by adr_country`Member ID Country但是,我知道它包含一些重复项,因为当我取出一个count函数并且没有group by子句时,它会返回140个不同的行。
这是我最初的查询语句..。SELECT airline company, country, count(country) "The no.of times the airline visits the country"
FROM因此,我尝试将case语句添加到select中,但它给了我like group函数。ELSE count(country) "The no.of times the airline visits the country"
在我的数据库表PE和PER中有两个字段(位数据类型),我需要编写一个sqlcase语句来执行以下任务。when PER=1 then check if PE=0 then print 'Not Completed’when PE=1 print 'Completed‘CASEpc.PER WHEN '0' THEN 'Not Required'