title: Why I can't select more than one column in my subquery?
body: <p>I've been doing this query </p>
  
  <pre><code>SELECT
      A.*,
      (
          SELECT
              SUM(IF(LENGTH(B.picture) &gt; 0, 1, 0)) AS A_picture_count,
              SUM(IF(LENGTH(B.video) &gt; 0, 1, 0)) AS A_video_count
          FROM B
          WHERE B.A_id = A.id
      )
  FROM A
  </code></pre>
  
  <p>which answers me with a <code>Operand should contain 1 column(s)</code> whereas </p>
  
  <pre><code>SELECT
      A.*,
      (
          SELECT
              SUM(IF(LENGTH(B.picture) &gt; 0, 1, 0)) AS A_picture_count
          FROM B
          WHERE B.A_id = A.id
      )
  FROM A
  </code></pre>
  
  <p>works perfectly. Why MariaDB would not let me subquery more than 1 column ? Am I missing something?</p>
  
  <hr>
  
  <p>As this question (<a href="https://stackoverflow.com/questions/14046838/mysql-operand-should-contain-1-columns">MySQL - Operand should contain 1 column(s)</a>) suggests,</p>
  
  <p>You probably would answer that I should go this way</p>
  
  <pre><code>SELECT t1.*, sq.*
  FROM table1 t1,
     (SELECT a,b,c FROM table2 ...) sq
  WHERE ...
  </code></pre>
  
  <p>or using a join (but my query is much more complicated and my many SUMS and COUNTS mess a lot with my GROUP BY).</p>
  
  <p>My question is more about "Why" than "How".</p>
  
  <hr>
  
  <p>My final solution (which is not optimal):</p>
  
  <pre><code>SELECT
      A.*,
      (
          SELECT
              SUM(IF(LENGTH(B.picture) &gt; 0, 1, 0)) AS A_picture_count,
          FROM B
          WHERE B.A_id = A.id
      )
      (
          SELECT
              SUM(IF(LENGTH(B.video) &gt; 0, 1, 0)) AS A_video_count
          FROM B
          WHERE B.A_id = A.id
      )
  FROM A
  </code></pre>