skip to Main Content

select count(memberid) cnt from memberdata where MemberID;

select count(Deleted) UnUsable from memberdata where deleted = 1;

select count(Deleted) Usable from memberdata where deleted = 0;

Question How to make this query to one?

2

Answers


  1. As both query zo count the deletd are independent of the WHERE clause

    make some suqueries of them

    select 
    count(memberid) cnt
    ,(SELECT count(deleted = 1) FROM memberdata) UnUsable
    , (SELECT count(deleted = 0) FROM memberdata) Usable 
    from memberdata where MemberID;
    
    Login or Signup to reply.
  2. You can use a query like this

    SELECT
      count(memberid) AS cnt,
      count(Deleted = 1) AS UnUsabl,
      count(Deleted = 0) AS Usable
    FROM memberdata;
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search