         assignments: [ColumnAssignment])
         throws -> UpdateStatement?
     {
-        if let groupExpressions = try groupPromise?.resolve(db), !groupExpressions.isEmpty {
+        switch try grouping(db) {
+        case .none:
+            break
+        case .unique:
+            return try makeTrivialUpdateStatement(db, conflictResolution: conflictResolution, assignments: assignments)
+        case .nonUnique:
             // Programmer error
             fatalError("Can't update query with GROUP BY clause")
-        }
-        
-        guard havingExpressions.isEmpty else {
-            // Programmer error
-            fatalError("Can't update query with HAVING clause")
-        }
-        
-        guard relation.joins.isEmpty else {
-            // Programmer error
-            fatalError("Can't update query with JOIN clause")
         }
         
         guard case .table = relation.source else {
             // Programmer error
             fatalError("Can't update without any database table")
+        }
+        
+        guard relation.joins.isEmpty else {
+            return try makeTrivialUpdateStatement(db, conflictResolution: conflictResolution, assignments: assignments)
         }
         
         if assignments.isEmpty {

        statement.arguments = context.arguments!
        return statement
    }

    /// Returns a select statement
    func makeSelectStatement(_ db: Database) throws -> SelectStatement {
        // Build an SQK generation context with all aliases found in the query,

    }
    
    func makeDeleteStatement(_ db: Database) throws -> UpdateStatement {
        switch try grouping(db) {
        case .none:
            break
        case .unique:
            return try makeTrivialDeleteStatement(db)
        case .nonUnique:
            // Programmer error
            fatalError("Can't delete query with GROUP BY clause")
        }
        
        guard case .table = relation.source else {
            // Programmer error
            fatalError("Can't delete without any database table")
        }
        
        guard relation.joins.isEmpty else {
            return try makeTrivialDeleteStatement(db)
        }
        
        var context = SQLGenerationContext.queryGenerationContext(aliases: relation.allAliases)
