This should be more efficient than running the queries one by one
DBAs don't want you to know about this One Simple Trick