title: SQL LEFT JOIN TABLE cause some error
body: <pre><code>SELECT COUNT(ORVM.APPID) AS 'Number of VMs', ORAP.ORDERID
      FROM    Order.[VirtualMachine] ORVM,
          Order.[Application] ORAP,
          Order.[ServiceOrder] SO
      WHERE   SO.ORDERID=ORAP.ORDERID AND
          ORAP.APPID=ORVM.APPID
      GROUP BY ORAP.ORDERID
  </code></pre>
  
  <hr>
  
  <pre><code>SELECT COUNT(ORVM.APPID) AS 'Number of VMs', ORAP.ORDERID
    FROM  Order.[ServiceOrder] SO,
      Order.[Application] ORAP
    LEFT JOIN Order.[VirtualMachine] ORVM
    ON ORAP.APPID=ORVM.APPID
    WHERE SO.ORDERID=ORAP.ORDERID
    GROUP BY ORAP.ORDERID
  </code></pre>
  
  <p>TABLE NAME: ORAP        </p>
  
  <pre><code>APPID   ORDERID APPNAME
  2   6   A
  3   7   B
  4   8   C
  5   9   D
  6   10  E
  9   11  F
  </code></pre>
  
  <p>TABLE NAME: ORVM        </p>
  
  <pre><code>VMID    APPID   VMNAME
  4   2   AA-1
  5   2   AA-2
  6   2   AA-3
  33  5   BB-1
  34  6   CC-1
  35  6   CC-2
  36  6   CC-3
  37  6   CC-4
  38  10  DD-1
  39  10  DD-2
  40  10  DD-3
  41  9   EE-1
  </code></pre>
  
  <p>TABLE NAME: SO      </p>
  
  <pre><code>ORDERID ORDERNUM    STATUS
  6   OR000001    NORMAL
  7   OR000002    NORMAL
  8   OR000003    NORMAL
  9   OR000004    NORMAL
  10  OR000005    NORMAL
  11  OR000006    NORMAL
  </code></pre>
  
  <p>And I would like to search how many VMs for each APP, SQL 1 output correct, SQL 2 output error. I would  like to find out the reason and make SQL 2 correct. </p>