using
Specifies a USING clause for a JOIN operation.
The USING clause is a shorthand for an ON clause when the columns to join on have the same name in both tables. It takes a single column that must exist in both of the tables being joined.
Example
// Assuming both Artists and Albums tables have an 'artistId' column.
// This is equivalent to:
// ... ON Artists.artistId = Albums.artistId
Artists
.select(Artists.artistName, Albums.title)
.join(Albums, JoinType.LEFT_JOIN)
.using(Artists.artistId) // or Albums.artistId, as long as the name matches
.execute()Content copied to clipboard
Return
A SelectStatement that can be further modified (e.g., with WHERE, ORDER BY) or executed.
Author
MOHAMMAD AZIM ANSARI
Parameters
column
The column to use for joining. This column name must be present in both tables involved in the join.