I have to see if a particular publish is goes to some category or goes to some descendant of the certain category. It is possible to wordpress function with this, or I have to get it done myself ?

Edit: I ought to have pointed out the Wordpress version is 2.7. sorry

$post = get_post($id);
$category = $post->$post_category;
cat_is_ancestor_of(($parent_category, $category));

For more information begin to see the get_post and cat is ancestor of references. Also, while somewhat difficult to get this is a great starting point for many wordpress development related things.

for just two.7 or over use within_category( $category, $_publish )

Regards, Vicky Biswas

Would the sql query use wordpress 2.8?