Originally posted by Saif uddin:
On the first look this query is not going to work because this will also count the ids having status as
0. however the query below is counting only ids which have status
1 also the query will display the description having status = 1 which is not expected from first query.
Top of all I am not sure what is the requirement to make a single query because first query
SELECT DESCRIPTION AS A FROM AREA WHERE STATUS = 0; will result in multiple rows and second query
SELECT COUNT(ID) AS B FROM AREA WHERE STATUS =1; will result in one row only.
Thanks,
Shailesh