MEDITECH DR Discovery Factory (BETA) 

 enter list of tables, then click build
 

 number for TOP N records
       

 where clause field (optional)     where clause value (optional)
   
  
 copy list of sql statements (CTRL + A, CTRL + C)