SQL query to select posts from multiple categories

I would use the built in API like Rarst mentioned. You could do something like this:

$just_seven = new WP_Query(
  array(
    'category__in' => array( 7 ),
    'category__not_in' => array( 10 )
  )
);

You would then have those items in $just_seven->posts.

However, if you MUST use a direct SQL statement, I’d suggest using INNER JOIN instead of LEFT JOIN.