use raw sql to do the query