This is a really helpful overview from BenBaltar on how to run a query on the $wpdb.
I personally used this when I created a function within a plugin to check if a post was a child of an array of posts.
One question I have is if it is the most efficient use of $wpdb. Let me know in the comments!
Really thanks for sharing these codes with us.
Thanks for checking it out!