Search code examples
phpmysqlsqldatabasecodeigniter

Query to search for a specific value in a db column


I want to know whether there are any '0's in the issues_status column of the issues table. The issues_status column store values: '0' & '1'. I guess a query find the count of 0's would give me the required result. May i know how to accomplish this.

issues Table

issues_id issues_status
1 1
2 0

Solution

  • SELECT COUNT(issues_status) 
    FROM issues 
    WHERE issues_status=0