title: Postgres: WHERE IN subselect with multiple columns?
body: <p>I'm new to Postgres -- and it's been years since I've done anything SQL related so I'm perhaps over-thinking this -- but...</p>
  
  <p>I have a subquery which selects a bunch of IDs (<code>cs_seed</code>) to perform another query on.</p>
  
  <p>What I'd like to be able to do is to maintain the order from the subquery. I've searched for hours and discovered the <code>row_number()</code> feature which seems promising, but I obviously can't use this in a <code>WHERE IN</code> query as it's returning multiple columns.</p>
  
  <pre><code>SELECT ca_seed, ca_biome, ca_percent 
  FROM colours_area 
  WHERE ca_seed IN (SELECT cs_seed, row_number() OVER (ORDER BY cs_percent DESC) AS rn 
                    FROM colours_spawn 
                    WHERE cs_biome = 140 
                    ORDER BY cs_percent DESC LIMIT 10) 
  ORDER BY rn DESC;
  </code></pre>
  
  <p>Is there any way I can do this? Or is my approach wrong?</p>