title: sql-ex exercise 39 failed on second server error?
body: <blockquote>
    <p>Exercise 39:  Define the ships that "survived for future battles";
    being damaged in one battle, they took part in another.</p>
  </blockquote>
  
  <p>Database Schema: <a href="http://www.sql-ex.ru/help/select13.php#db_3" rel="nofollow">http://www.sql-ex.ru/help/select13.php#db_3</a></p>
  
  <p>My approach: </p>
  
  <pre><code>SELECT distinct o.ship from Outcomes o
  WHERE o.RESULT = 'damaged' 
  AND exists (select 1 FROM Outcomes o2 WHERE o2.ship = o.ship 
  AND (o2.result='OK' OR o2.result='sunk'))
  </code></pre>
  
  <p>sql-ex says</p>
  
  <blockquote>
    <p>Your query produced correct result set on main database, but it failed
    test on second, checking database</p>
  </blockquote>
  
  <p>correct result matched with my output.</p>
  
  <p>Where I failed?</p>