title: Why can't this subquery return more than one row?
body: <p>This <strong>Query</strong> is being generated by Django ORM using RawSQL:</p>
  
  <pre><code>SELECT `productos`.`codigo_barras`, (
          SELECT
              articulos.costo_us * (1 + articulos.iva_coef)
          FROM
              articulos
          INNER JOIN (
                  SELECT 
                      articulos.id, MAX(encargosProveedor.fecha_entrega)
                  FROM
                      articulos, encargosProveedor_listado_articulos, encargosProveedor, itemArticulosProveedor
                  WHERE
                      articulos.id = itemArticulosProveedor.articulos_id AND
                      encargosProveedor.id = encargosProveedor_listado_articulos.encargosproveedor_id
                  GROUP BY
                      articulos.producto_id
              )
          AS ultimos ON articulos.id = ultimos.id
  ) AS `ultimo_precio` FROM `productos`
  </code></pre>
  
  <p>It's giving an <strong>error</strong></p>
  
  <blockquote>
    <p>1242 - Subquery returns more than 1 row</p>
  </blockquote>
  
  <p>This is the result of the <strong>subquery</strong></p>
  
  <pre><code>+----+--------------------------------------+
  | id | MAX(encargosProveedor.fecha_entrega) |
  +----+--------------------------------------+
  |  1 |              2019-04-17              |
  +----+--------------------------------------+
  |  3 |              2019-04-17              |
  +----+--------------------------------------+
  </code></pre>
  
  <p>I read the MYSQL documentation but i can't understand why is there a problem with returning two rows. I've tried a lot of alternatives.</p>
  
  <p><strong>Where is the problem?</strong> </p>