This took me a while to figure out when I started intuitively using $wpdb->query to pull in results from a query in a custom table in WordPress.
However, $wpdb->query only returns the count of the query. You have to use $wpdb->get_results to get the actual SELECT statement back.
Good to know, and will save you some time if you stumble across this trying to figure out why WordPress is returning the count to you rather than the the query results.