Skip to content
It's Vapor Week! Celebrating 10 Years of Vapor Read more

Instance Method

where(_:_:column:)

Adds a column to column comparison to this builder’s WHERE clause by ANDing.
@discardableResult func `where`(_ lhs: String, _ op: SQLBinaryOperator, column rhs: String) -> Self

Discussion

builder.where("firstName", .equal, column: "lastName")

This method compares two columns.

SELECT * FROM "users" WHERE "firstName" = "lastName"