             } else {
                 return "\(tableName.quotedDatabaseIdentifier)"
             }
-        case let .commonTableExpression(alias):
-            return context.resolvedName(for: alias).quotedDatabaseIdentifier
         case let .subquery(generator):
             let sql = try generator.requestSQL(context)
             return "(\(sql))"

    var alias: TableAlias? {
        switch self {
        case let .table(_, alias):
            return alias
        case let .commonTableExpression(alias):
            return alias
        case .subquery:
            return nil

/// A "qualified" source, where all tables are identified with a table alias.
private enum SQLQualifiedSource {
    case table(tableName: String, alias: TableAlias)
    indirect case subquery(SQLQueryGenerator)
    
    /// Nil for subquery sources.
