The database has a function to do so itself, it's been awhile but I think that it used qselect or some such.
So select the Add Command under the database connection and paste in real SQL to return the data in a usable fashion, or perhaps you can create a View or Stored Procedure to return the data.
-k