title: SQL: Put rows at top of query if a column exists elsewhere
body: <p>I have a rows in a table that multiple users will view. Users can "favorite" a row, which adds the username/row key to a separate table.</p>
  
  <p>I want to make a query that orders "favorites" to the top. I assume this would require a subquery, but I'm not sure on the best way to proceed.</p>
  
  <p>One idea I had was to query my table where it exists in favorites, and then union all to a query where it doesn't exist in favorites. But I'm wondering if there's a better way.</p>