Here are some examples of tapquery:
stilts tapquery tapurl=https://gea.esac.esa.int/tap-server/tap
                adql='SELECT TOP 1000 source_id, ra, dec
                      FROM gaiadr3.gaia_source
                      ORDER BY random_index'
                out=g.fits
stilts tapquery tapurl=https://gea.esac.esa.int/tap-server/tap
                adql='SELECT TOP 1000 source_id, ra, dec
                      FROM gaiadr3.gaia_source
                      ORDER BY random_index'
                sync=true auth=true
                out=g.fits
sync=true runs the query synchronously
    instead of asynchronously, and
    auth=true will attempt to log in to the service
    (prompting you for username and password) if it offers authentication.
    
stilts tapquery
       tapurl=http://dc.g-vo.org/tap
       adql='SELECT *
             FROM twomass.data AS t
             JOIN TAP_UPLOAD.up1 AS s
                  ON DISTANCE(t.raj2000,t.dej2000,s.ra2000,s.dec2000)<5./3600'
       nupload=1 upload1=6dfgs_E7.fits ucmd1='select BMAG-RMAG<0'
       maxrec=20000
       ocmd='tablename 2mass_x_6df' omode=topcat
6dfgs_E7 is filtered to contain only
    rather blue objects, and the resulting selection is uploaded to the
    TAP server.  A positional crossmatch with 5 arcsec tolerance 
    is then performed on the server between this uploaded table and the
    twomass.data table held by the service.
    The adjusted maxrec parameter ensures that the result
    will not be artificially truncated to shorter than 20000 rows
    (assuming the service limits permit this).
    When the result is received, it is loaded directly into TOPCAT with
    the name "2mass_x_6df".