title: Count two different columns values from the same table using SQLite Database table in android
body: <p>I am trying to select multiple values from the same table. I need to select count values of the column rfid and process_status from the posts table and station_title from stations table. </p>
  
  <p>Here are the two tables:</p>
  
  <p><strong>Posts table :</strong> </p>
  
  <pre>
  Id   ownerId   rfid    stationId      stationType    process_status
  1       107        rfid1  raj1222681607   like             pending
  2       107        rfid1  raj1222681607   like             pending
  3      107        rfid1  raj1125396157    like             pending
  4       107        rfid1  raj1222681607   like             
  5       107        rfid2  raj1222681607   like             pending
  6       107        rfid3  raj1222681607   like             
  </pre>
  
  <p><strong>Stations table :</strong> </p>
  
  <pre>
  Id   title    ownerId    stationId     stationLike    stationPic
  1    Check-in one         107             raj1125396157    1              0
  2    nfc station 01      107             raj1222681607     1             0
  </pre>
  
  <p>From these two tables I want to fetch data as </p>
  
  <pre>
  Total RFIDs : 5
  Total Pending : 3
  Station Title : nfc station 01
  </pre>
  
  <p>The where clause conditions are : ownerId = 107 and the stationId = 'raj1222681607' and the process_status = 'pending'</p>
  
  <p>So far I can achieve the total rfids, station title value; but i am not able to get the total pending value counting the process status.</p>
  
  <p>My query snippet:</p>
  
  <pre><code>  SELECT
          COUNT(p.rfid) as TotalTap,
          COUNT(p.process_status) as TotalPending,
          s.title
      FROM posts p
      inner join
      stations s
      on p.stationId = s.stationId
      WHERE
      p.ownerId = 107 AND p.stationId = 'raj1222681607'
      AND p.process_status = 'pending';
  </code></pre>
  
  <p>But this is giving the wrong output as :
           Total RFIDs : 3 (THIS IS WRONG!!)
           Total Pending : 3
           Station Title : nfc station 01</p>