주로 php /mysql를 다뤄서요..
sqlite 는 메뉴얼을 봐도 많이 헷갈리네요..
"SELECT count(1) AS total,
count( if(choice= '1', choice, null)) AS agree,
count( if(choice= '2', choice, null) )AS deny
FROM test_db
WHERE deviceID='".$deviceID."' ";
다음과 같은 쿼리를 sqlite DB 쿼리 로 표현하고 싶은데...혹시 아시나요..
이렇게 해보세요. ^^
select count(
(case choice when '1' then choide else null end)
)
from test_db