First, never use query_posts
, use WP_Query
for additional queries, or pre_get_posts
to alter the main query.
Refer to WP_Query
in Codex for a complete list of available arguments. You want to use category__not_in
in this case:
$args = array(
'category__in' => array(1),
'category__not_in' => array(2)
);
$query = new WP_Query( $args );