title: SQL subquery combine with UNION ALL query
body: <p>I have two tables: goods with column id and cost and good_texts with columns goodid, languageid, title. So good_texts contains translations for good.</p>
  
  <p>I have query that selects title for current language if it available and selects default title if it is not available for one good:</p>
  
  <pre><code>    SELECT
      *
  FROM
      good_texts
  WHERE
      languageid = 2
  UNION ALL
      SELECT
          *
      FROM
          good_texts
      WHERE
          languageid = 1 AND goodid = 92
      AND goodid NOT IN (
          SELECT
              goodid
          FROM
              good_texts
          WHERE
              languageid = 2 and goodid = 92
      )
  </code></pre>
  
  <p>This works fine and returns only one row.
  Now I'm trying to write query to get all data from good table as well as title from good_texts table.
  I'm trying to do this using this query:</p>
  
  <pre><code>    SELECT
      s1.id,
      s1.cost,
      (SELECT
      s2.title
  FROM
      good_texts s2
  WHERE
      languageid = 2
  UNION ALL
      SELECT
          s3.title
      FROM
          good_texts s3
      WHERE
          languageid = 1 AND s3.goodid = s1.id
      AND s3.goodid NOT IN (
          SELECT
              s4.goodid
          FROM
              good_texts s4
          WHERE
              languageid = 2 AND s4.goodid = s1.id
      ))
  FROM
      goods s1
  </code></pre>
  
  <p>But this doesn't work with error </p>
  
  <blockquote>
    <p>more than one row returned by a subquery used as an expression</p>
  </blockquote>
  
  <p>I can't understand why my subquery returns more than one row even so it returns one row if it runs separately. 
  How my goal can be achieved? </p>