'Creates the SQL for this query. Returns the SQL string and list of
parameters.'

def as_sql(self):

    assert (len(self.query.tables) == 1), 'Can    only    delete    from    one    table    at    a    time.'
    qn = self.quote_name_unless_alias
    result = [('DELETE    FROM    %s' % qn(self.query.tables[0]))]
    (where, params) = self.query.where.as_sql(qn=qn, connection=self.connection)
    if where:
        result.append(('WHERE    %s' % where))
    return ('    '.join(result), tuple(params))
