def query(self, query='', name='', sortlist='', columns='',
              limit=0, offset=0, style='Python'):
        if not query and not sortlist and not columns and \
           limit <= 0 and offset <= 0:
            raise ValueError('No selection done (arguments query, ' +
                             'sortlist, columns, limit, and offset are empty)')
        command = 'select '
        if columns:
            command += columns
        command += ' from $1'
        if query:
            command += ' where ' + query
        if sortlist:
            command += ' orderby ' + sortlist
        if limit > 0:
            command += ' limit %d' % limit
        if offset > 0:
            command += ' offset %d' % offset
        if name:
            command += ' giving ' + name
        return tablecommand(command, style, [self])