title: How to Count Number of in in a field
body: <p>I have a data base named nominator which has some fields </p>
  
  <p>it have a in field named <em>'noinatedUnder'</em> how can i show the number of inS to that field</p>
  
  <p>this is the Raw text of 
  <strong>SELECT FROM Nominator</strong> </p>
  
  <pre><code>{
      "result": [
          {
              "@type": "d",
              "@rid": "#73:2",
              "@version": 2,
              "@class": "Nominator",
              "isTemp": "true",
              "id": "JJRXW",
              "Email": "testuser@test.com",
              "Name": "nijeesh",
              "Phone": "7894561234",
              "school": "#65:2",
              "in_noinatedUnder": [
                  "#161:1",
                  "#162:1",
                  "#163:1",
                  "#164:0",
                  "#165:0",
                  "#166:0",
                  "#167:0",
                  "#168:0",
                  "#161:0",
                  "#162:0",
                  "#163:0"
              ],
              "@fieldTypes": "school=x,in_noinatedUnder=g"
          },
          {
              "@type": "d",
              "@rid": "#74:0",
              "@version": 1,
              "@class": "Nominator",
              "isTemp": "true",
              "id": "SU7SV",
              "Email": "npms@school.com",
              "Name": "pon muthu",
              "Phone": "7778455215",
              "school": "#65:2",
              "@fieldTypes": "school=x"
          },
          {
              "@type": "d",
              "@rid": "#75:1",
              "@version": 1,
              "@class": "Nominator",
              "isTemp": "true",
              "id": "4DZ86",
              "Email": "sivaraj@testschool.com",
              "Name": "sivaraj",
              "Phone": "7788899445",
              "school": "#65:2",
              "@fieldTypes": "school=x"
          },
          {
              "@type": "d",
              "@rid": "#76:1",
              "@version": 1,
              "@class": "Nominator",
              "isTemp": "true",
              "id": "HFQJ1",
              "Email": "klndk@knvd.com",
              "Name": "dbhbsd",
              "Phone": "8656548745",
              "school": "#65:2",
              "@fieldTypes": "school=x"
          }
      ],
      "notification": "Query executed in 6.12 sec. Returned 4 record(s)"
  }
  </code></pre>
  
  <p>in this on the first entry there is 11 entrys in the in->nominated under area and 0 on everything else  how to select this number using sql for each field</p>
  
  <p>that is it should print </p>
  
  <pre><code>-----------
  count |                                                                           ----------
  11
  0
  0
  0
  </code></pre>
  
  <p>i did got the result using php</p>
  
  <pre><code>    $query = "select * from `Nominator`";
      $result = runquery($query);
      $a = array();
  
      for($i=0;$i&lt;sizeof($result);$i++)
      {
      echo '&lt;p&gt;';
          echo isset($result[$i]-&gt;oData-&gt;in_noinatedUnder)?sizeof($result[$i]-&gt;oData-&gt;in_noinatedUnder):0;
  
      echo '&lt;/p&gt;';
      }
  
  function runquery($query)
  {
      $client = new PhpOrient();
      $client-&gt;hostname = 'localhost';
      $client-&gt;port = 2424;
      $client-&gt;username = 'root';
      $client-&gt;password = 'hello';
      $client-&gt;connect();
      $client-&gt;dbOpen('tabe');
  
  
      $result = $client-&gt;query($query);
  
  
  
      $json = json_decode(json_encode($result));
  
  
  
      if (sizeof($json) &gt; 0) {
          return $json;
      } else {
          return false;
      }
  
  }
  </code></pre>
  
  <p>So is there any way to get the count directly from sql it self, like <strong>select count(*) from nominator</strong> gives count of nominators</p>