Qore SqlUtil Module Reference  1.7.1
SQL Join Operator Functions

Functions

hash< string, hash< JoinOperatorInfo > > SqlUtil::join_inner (AbstractTable table, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
 returns a hash for standard inner joins with the given arguments More...
 
hash< string, hash< JoinOperatorInfo > > SqlUtil::join_inner (Table table, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
 returns a hash for standard inner joins with the given arguments More...
 
hash< string, hash< JoinOperatorInfo > > SqlUtil::join_inner (string table_name, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
 returns a hash for standard inner joins with the given arguments More...
 
hash< string, hash< JoinOperatorInfo > > SqlUtil::join_inner (string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
 returns a hash for standard inner joins with the given arguments for use when joining with a table other than the primary table More...
 
hash< string, hash< JoinOperatorInfo > > SqlUtil::join_inner (string ta, Table table, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
 returns a hash for standard inner joins with the given arguments for use when joining with a table other than the primary table More...
 
hash< string, hash< JoinOperatorInfo > > SqlUtil::join_inner_alias (string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
 returns a hash for standard inner joins with the given arguments for use when joining with a table other than the primary table More...
 
hash< string, hash< JoinOperatorInfo > > SqlUtil::join_left (AbstractTable table, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
 returns a hash for left outer joins with the given arguments More...
 
hash< string, hash< JoinOperatorInfo > > SqlUtil::join_left (Table table, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
 returns a hash for left outer joins with the given arguments More...
 
hash< string, hash< JoinOperatorInfo > > SqlUtil::join_left (string table_name, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
 returns a hash for left outer joins with the given arguments More...
 
hash< string, hash< JoinOperatorInfo > > SqlUtil::join_left (string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
 returns a hash for left outer joins with the given arguments for use when joining with a table other than the primary table More...
 
hash< string, hash< JoinOperatorInfo > > SqlUtil::join_left (string ta, Table table, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
 returns a hash for left outer joins with the given arguments for use when joining with a table other than the primary table More...
 
hash< string, hash< JoinOperatorInfo > > SqlUtil::join_left_alias (string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
 returns a hash for left outer joins with the given arguments for use when joining with a table other than the primary table More...
 
hash< string, hash< JoinOperatorInfo > > SqlUtil::join_right (AbstractTable table, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
 returns a hash for right outer joins with the given arguments More...
 
hash< string, hash< JoinOperatorInfo > > SqlUtil::join_right (Table table, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
 returns a hash for right outer joins with the given arguments More...
 
hash< string, hash< JoinOperatorInfo > > SqlUtil::join_right (string table_name, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
 returns a hash for right outer joins with the given arguments More...
 
hash< string, hash< JoinOperatorInfo > > SqlUtil::join_right (string ta, AbstractTable table, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
 returns a hash for right outer joins with the given arguments for use when joining with a table other than the primary table More...
 
hash< string, hash< JoinOperatorInfo > > SqlUtil::join_right (string ta, Table table, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
 returns a hash for right outer joins with the given arguments for use when joining with a table other than the primary table More...
 
hash< string, hash< JoinOperatorInfo > > SqlUtil::join_right_alias (string ta, string table_name, *string alias, *hash jcols, *hash cond, *hash< auto > opt)
 returns a hash for right outer joins with the given arguments for use when joining with a table other than the primary table More...
 
hash< string, hash< JoinOperatorInfo > > SqlUtil::make_jop (string jop, AbstractTable table, *string alias, *hash jcols, *hash cond, *string ta, *hash< auto > opt)
 returns hash keyed with the table name assigned to a JoinOperatorInfo hash More...
 
hash< string, hash< JoinOperatorInfo > > SqlUtil::make_jop (string jop, string table_name, *string alias, *hash jcols, *hash cond, *string ta, *hash< auto > opt)
 returns a hash keyed with the table name assigned to a JoinOperatorInfo hash More...
 

Detailed Description

These are functions that can be used in the join argument in a select option hash:

Note
for join functions, explicit join columns do not need to be specified in the case that a foreign key in one table exists to the primary key of the other table; in this case this information is assumed for the join automatically

Function Documentation

◆ join_inner() [1/5]

hash<string, hash<JoinOperatorInfo> > SqlUtil::join_inner ( AbstractTable  table,
*string  alias,
*hash  jcols,
*hash  cond,
*hash< auto >  opt 
)

returns a hash for standard inner joins with the given arguments

Example With Explicit Join Columns:
*list<auto> rows = table.selectRows(("join": join_inner(table2, "t2", ("id": "altid"))));
Example With Implicit Join Columns:
(using an automatically detected foreign key to primary key constraint)
*list<auto> rows = table.selectRows(("join": join_inner(table2)));
Parameters
tablethe table to join with
aliasthe alias for table in the query
jcolsthe columns to use for the join, the keys will be columns in the source table and the values are columns in the table argument; if this argument is NOTHING, then if there is any foreign key in one table pointing to the primary key of the other table, then this information is automatically assumed as the join condition; a foreign constraint in the current table to the primary key in table will be used first if it exists
condadditional conditions for the join clause for the table argument; see Where Clauses for more information
optoptional join options (for example, to specify a partition for the join if supported)
Returns
a join description hash corresponding to the arguments for use in the join argument of a select option hash

◆ join_inner() [2/5]

hash<string, hash<JoinOperatorInfo> > SqlUtil::join_inner ( Table  table,
*string  alias,
*hash  jcols,
*hash  cond,
*hash< auto >  opt 
)

returns a hash for standard inner joins with the given arguments

Example With Explicit Join Columns:
*list<auto> rows = table.selectRows(("join": join_inner(table2, "t2", ("id": "altid"))));
Example With Implicit Join Columns:
(using an automatically detected foreign key to primary key constraint)
*list<auto> rows = table.selectRows(("join": join_inner(table2)));
Parameters
tablethe table to join with
aliasthe alias for table in the query
jcolsthe columns to use for the join, the keys will be columns in the source table and the values are columns in the table argument; if this argument is NOTHING, then if there is any foreign key in one table pointing to the primary key of the other table, then this information is automatically assumed as the join condition; a foreign constraint in the current table to the primary key in table will be used first if it exists
condadditional conditions for the join clause for the table argument; see Where Clauses for more information
optoptional join options (for example, to specify a partition for the join if supported)
Returns
a join description hash corresponding to the arguments for use in the join argument of a select option hash

◆ join_inner() [3/5]

hash<string, hash<JoinOperatorInfo> > SqlUtil::join_inner ( string  table_name,
*string  alias,
*hash  jcols,
*hash  cond,
*hash< auto >  opt 
)

returns a hash for standard inner joins with the given arguments

Example With Explicit Join Columns:
*list<auto> rows = table.selectRows(("join": join_inner(table2, "t2", ("id": "altid"))));
Example With Implicit Join Columns:
(using an automatically detected foreign key to primary key constraint)
*list<auto> rows = table.selectRows(("join": join_inner(table2)));
Parameters
table_namethe table to join with; table will be subject to deferred resolution
aliasthe alias for table in the query
jcolsthe columns to use for the join, the keys will be columns in the source table and the values are columns in the table argument; if this argument is NOTHING, then if there is any foreign key in one table pointing to the primary key of the other table, then this information is automatically assumed as the join condition; a foreign constraint in the current table to the primary key in table will be used first if it exists
condadditional conditions for the join clause for the table argument; see Where Clauses for more information
optoptional join options (for example, to specify a partition for the join if supported)
Returns
a join description hash corresponding to the arguments for use in the join argument of a select option hash

◆ join_inner() [4/5]

hash<string, hash<JoinOperatorInfo> > SqlUtil::join_inner ( string  ta,
AbstractTable  table,
*string  alias,
*hash  jcols,
*hash  cond,
*hash< auto >  opt 
)

returns a hash for standard inner joins with the given arguments for use when joining with a table other than the primary table

Example With Explicit Join Columns:
*list<auto> rows = table.selectRows(("join": join_inner(table2, "t2", ("id": "altid")) + join_inner("t2", table3)));
Example With Implicit Join Columns:
(using an automatically detected foreign key to primary key constraint)
*list<auto> rows = table.selectRows(("join": join_inner(table2)));
Parameters
tathe table name or alias of the other table to join with when not joining with the primary table
tablethe table to join with
aliasthe alias for table in the query
jcolsthe columns to use for the join, the keys will be columns in the source table and the values are columns in the table argument; if this argument is NOTHING, then if there is any foreign key in one table pointing to the primary key of the other table, then this information is automatically assumed as the join condition; a foreign constraint in the current table to the primary key in table will be used first if it exists
condadditional conditions for the join clause for the table argument; see Where Clauses for more information
optoptional join options (for example, to specify a partition for the join if supported)
Returns
a join description hash corresponding to the arguments for use in the join argument of a select option hash
Since
SqlUtil 1.3

◆ join_inner() [5/5]

hash<string, hash<JoinOperatorInfo> > SqlUtil::join_inner ( string  ta,
Table  table,
*string  alias,
*hash  jcols,
*hash  cond,
*hash< auto >  opt 
)

returns a hash for standard inner joins with the given arguments for use when joining with a table other than the primary table

Example With Explicit Join Columns:
*list<auto> rows = table.selectRows(("join": join_inner(table2, "t2", ("id": "altid")) + join_inner("t2", table3)));
Example With Implicit Join Columns:
(using an automatically detected foreign key to primary key constraint)
*list<auto> rows = table.selectRows(("join": join_inner(table2)));
Parameters
tathe table name or alias of the other table to join with when not joining with the primary table
tablethe table to join with
aliasthe alias for table in the query
jcolsthe columns to use for the join, the keys will be columns in the source table and the values are columns in the table argument; if this argument is NOTHING, then if there is any foreign key in one table pointing to the primary key of the other table, then this information is automatically assumed as the join condition; a foreign constraint in the current table to the primary key in table will be used first if it exists
condadditional conditions for the join clause for the table argument; see Where Clauses for more information
optoptional join options (for example, to specify a partition for the join if supported)
Returns
a join description hash corresponding to the arguments for use in the join argument of a select option hash

◆ join_inner_alias()

hash<string, hash<JoinOperatorInfo> > SqlUtil::join_inner_alias ( string  ta,
string  table_name,
*string  alias,
*hash  jcols,
*hash  cond,
*hash< auto >  opt 
)

returns a hash for standard inner joins with the given arguments for use when joining with a table other than the primary table

Example With Explicit Join Columns:
*list<auto> rows = table.selectRows(("join": join_inner(table2, "t2", ("id": "altid")) + join_inner("t2", table3)));
Example With Implicit Join Columns:
(using an automatically detected foreign key to primary key constraint)
*list<auto> rows = table.selectRows(("join": join_inner(table2)));
Parameters
tathe table name or alias of the other table to join with when not joining with the primary table
table_namethe table to join with
aliasthe alias for table in the query
jcolsthe columns to use for the join, the keys will be columns in the source table and the values are columns in the table argument; if this argument is NOTHING, then if there is any foreign key in one table pointing to the primary key of the other table, then this information is automatically assumed as the join condition; a foreign constraint in the current table to the primary key in table will be used first if it exists
condadditional conditions for the join clause for the table argument; see Where Clauses for more information
optoptional join options (for example, to specify a partition for the join if supported)
Returns
a join description hash corresponding to the arguments for use in the join argument of a select option hash
Since
SqlUtil 1.3

◆ join_left() [1/5]

hash<string, hash<JoinOperatorInfo> > SqlUtil::join_left ( AbstractTable  table,
*string  alias,
*hash  jcols,
*hash  cond,
*hash< auto >  opt 
)

returns a hash for left outer joins with the given arguments

Example With Explicit Join Columns:
*list<auto> rows = table.selectRows(("join": join_left(table2, "t2", ("id": "altid"), ("tag", op_like("offset%")))));
Example With Implicit Join Columns:
(using an automatically detected foreign key to primary key constraint)
*list<auto> rows = table.selectRows(("join": join_left(table2, "t2", NOTHING, ("tag", op_like("offset%")))));
Parameters
tablethe table to join with
aliasthe alias for table in the query
jcolsthe columns to use for the join, the keys will be columns in the source table and the values are columns in the table argument; if this argument is NOTHING, then if there is any foreign key in one table pointing to the primary key of the other table, then this information is automatically assumed as the join condition; a foreign constraint in the current table to the primary key in table will be used first if it exists
condadditional conditions for the join clause for the table argument; see Where Clauses for more information
optoptional join options (for example, to specify a partition for the join if supported)
Returns
a join description hash corresponding to the arguments for use in the join argument of a select option hash

◆ join_left() [2/5]

hash<string, hash<JoinOperatorInfo> > SqlUtil::join_left ( Table  table,
*string  alias,
*hash  jcols,
*hash  cond,
*hash< auto >  opt 
)

returns a hash for left outer joins with the given arguments

Example With Explicit Join Columns:
*list<auto> rows = table.selectRows(("join": join_left(table2, "t2", ("id": "altid"), ("tag", op_like("offset%")))));
Example With Implicit Join Columns:
(using an automatically detected foreign key to primary key constraint)
*list<auto> rows = table.selectRows(("join": join_left(table2, "t2", NOTHING, ("tag", op_like("offset%")))));
Parameters
tablethe table to join with
aliasthe alias for table in the query
jcolsthe columns to use for the join, the keys will be columns in the source table and the values are columns in the table argument; if this argument is NOTHING, then if there is any foreign key in one table pointing to the primary key of the other table, then this information is automatically assumed as the join condition; a foreign constraint in the current table to the primary key in table will be used first if it exists
condadditional conditions for the join clause for the table argument; see Where Clauses for more information
optoptional join options (for example, to specify a partition for the join if supported)
Returns
a join description hash corresponding to the arguments for use in the join argument of a select option hash

◆ join_left() [3/5]

hash<string, hash<JoinOperatorInfo> > SqlUtil::join_left ( string  table_name,
*string  alias,
*hash  jcols,
*hash  cond,
*hash< auto >  opt 
)

returns a hash for left outer joins with the given arguments

Example With Explicit Join Columns:
*list<auto> rows = table.selectRows(("join": join_left(table2, "t2", ("id": "altid"), ("tag", op_like("offset%")))));
Example With Implicit Join Columns:
(using an automatically detected foreign key to primary key constraint)
*list<auto> rows = table.selectRows(("join": join_left(table2, "t2", NOTHING, ("tag", op_like("offset%")))));
Parameters
table_namethe table to join with
aliasthe alias for table in the query
jcolsthe columns to use for the join, the keys will be columns in the source table and the values are columns in the table argument; if this argument is NOTHING, then if there is any foreign key in one table pointing to the primary key of the other table, then this information is automatically assumed as the join condition; a foreign constraint in the current table to the primary key in table will be used first if it exists
condadditional conditions for the join clause for the table argument; see Where Clauses for more information
optoptional join options (for example, to specify a partition for the join if supported)
Returns
a join description hash corresponding to the arguments for use in the join argument of a select option hash
Since
SqlUtil 1.3

◆ join_left() [4/5]

hash<string, hash<JoinOperatorInfo> > SqlUtil::join_left ( string  ta,
AbstractTable  table,
*string  alias,
*hash  jcols,
*hash  cond,
*hash< auto >  opt 
)

returns a hash for left outer joins with the given arguments for use when joining with a table other than the primary table

Example With Explicit Join Columns:
*list<auto> rows = table.selectRows(("join": join_left(table2, "t2", ("id": "altid"), ("tag", op_like("offset%"))) + join_left("t2", table3, "t3")));
Example With Implicit Join Columns:
(using an automatically detected foreign key to primary key constraint)
*list<auto> rows = table.selectRows(("join": join_left(table2, "t2", NOTHING, ("tag", op_like("offset%"))) + join_left("t2", table3, "t3")));
Parameters
tathe table name or alias of the other table to join with when not joining with the primary table
tablethe table to join with
aliasthe alias for table in the query
jcolsthe columns to use for the join, the keys will be columns in the source table and the values are columns in the table argument; if this argument is NOTHING, then if there is any foreign key in one table pointing to the primary key of the other table, then this information is automatically assumed as the join condition; a foreign constraint in the current table to the primary key in table will be used first if it exists
condadditional conditions for the join clause for the table argument; see Where Clauses for more information
optoptional join options (for example, to specify a partition for the join if supported)
Returns
a join description hash corresponding to the arguments for use in the join argument of a select option hash

◆ join_left() [5/5]

hash<string, hash<JoinOperatorInfo> > SqlUtil::join_left ( string  ta,
Table  table,
*string  alias,
*hash  jcols,
*hash  cond,
*hash< auto >  opt 
)

returns a hash for left outer joins with the given arguments for use when joining with a table other than the primary table

Example With Explicit Join Columns:
*list<auto> rows = table.selectRows(("join": join_left(table2, "t2", ("id": "altid"), ("tag", op_like("offset%"))) + join_left("t2", table3, "t3")));
Example With Implicit Join Columns:
(using an automatically detected foreign key to primary key constraint)
*list<auto> rows = table.selectRows(("join": join_left(table2, "t2", NOTHING, ("tag", op_like("offset%"))) + join_left("t2", table3, "t3")));
Parameters
tathe table name or alias of the other table to join with when not joining with the primary table
tablethe table to join with
aliasthe alias for table in the query
jcolsthe columns to use for the join, the keys will be columns in the source table and the values are columns in the table argument; if this argument is NOTHING, then if there is any foreign key in one table pointing to the primary key of the other table, then this information is automatically assumed as the join condition; a foreign constraint in the current table to the primary key in table will be used first if it exists
condadditional conditions for the join clause for the table argument; see Where Clauses for more information
optoptional join options (for example, to specify a partition for the join if supported)
Returns
a join description hash corresponding to the arguments for use in the join argument of a select option hash

◆ join_left_alias()

hash<string, hash<JoinOperatorInfo> > SqlUtil::join_left_alias ( string  ta,
string  table_name,
*string  alias,
*hash  jcols,
*hash  cond,
*hash< auto >  opt 
)

returns a hash for left outer joins with the given arguments for use when joining with a table other than the primary table

Example With Explicit Join Columns:
*list<auto> rows = table.selectRows(("join": join_left(table2, "t2", ("id": "altid"), ("tag", op_like("offset%"))) + join_left("t2", table3, "t3")));
Example With Implicit Join Columns:
(using an automatically detected foreign key to primary key constraint)
*list<auto> rows = table.selectRows(("join": join_left(table2, "t2", NOTHING, ("tag", op_like("offset%"))) + join_left("t2", table3, "t3")));
Parameters
tathe table name or alias of the other table to join with when not joining with the primary table
table_namethe table to join with
aliasthe alias for table in the query
jcolsthe columns to use for the join, the keys will be columns in the source table and the values are columns in the table argument; if this argument is NOTHING, then if there is any foreign key in one table pointing to the primary key of the other table, then this information is automatically assumed as the join condition; a foreign constraint in the current table to the primary key in table will be used first if it exists
condadditional conditions for the join clause for the table argument; see Where Clauses for more information
optoptional join options (for example, to specify a partition for the join if supported)
Returns
a join description hash corresponding to the arguments for use in the join argument of a select option hash
Since
SqlUtil 1.3

◆ join_right() [1/5]

hash<string, hash<JoinOperatorInfo> > SqlUtil::join_right ( AbstractTable  table,
*string  alias,
*hash  jcols,
*hash  cond,
*hash< auto >  opt 
)

returns a hash for right outer joins with the given arguments

Example With Explicit Join Columns:
*list<auto> rows = table.selectRows(("join": join_right(table2, "t2", ("id": "altid"), ("tag", op_like("offset%")))));
Example With Implicit Join Columns:
(using an automatically detected foreign key to primary key constraint)
*list<auto> rows = table.selectRows(("join": join_right(table2, "t2", NOTHING, ("tag", op_like("offset%")))));
Parameters
tablethe table to join with
aliasthe alias for table in the query
jcolsthe columns to use for the join, the keys will be columns in the source table and the values are columns in the table argument; if this argument is NOTHING, then if there is any foreign key in one table pointing to the primary key of the other table, then this information is automatically assumed as the join condition; a foreign constraint in the current table to the primary key in table will be used first if it exists
condadditional conditions for the join clause for the table argument; see Where Clauses for more information
optoptional join options (for example, to specify a partition for the join if supported)
Returns
a join description hash corresponding to the arguments for use in the join argument of a select option hash

◆ join_right() [2/5]

hash<string, hash<JoinOperatorInfo> > SqlUtil::join_right ( Table  table,
*string  alias,
*hash  jcols,
*hash  cond,
*hash< auto >  opt 
)

returns a hash for right outer joins with the given arguments

Example With Explicit Join Columns:
*list<auto> rows = table.selectRows(("join": join_right(table2, "t2", ("id": "altid"), ("tag", op_like("offset%")))));
Example With Implicit Join Columns:
(using an automatically detected foreign key to primary key constraint)
*list<auto> rows = table.selectRows(("join": join_right(table2, "t2", NOTHING, ("tag", op_like("offset%")))));
Parameters
tablethe table to join with
aliasthe alias for table in the query
jcolsthe columns to use for the join, the keys will be columns in the source table and the values are columns in the table argument; if this argument is NOTHING, then if there is any foreign key in one table pointing to the primary key of the other table, then this information is automatically assumed as the join condition; a foreign constraint in the current table to the primary key in table will be used first if it exists
condadditional conditions for the join clause for the table argument; see Where Clauses for more information
optoptional join options (for example, to specify a partition for the join if supported)
Returns
a join description hash corresponding to the arguments for use in the join argument of a select option hash

◆ join_right() [3/5]

hash<string, hash<JoinOperatorInfo> > SqlUtil::join_right ( string  table_name,
*string  alias,
*hash  jcols,
*hash  cond,
*hash< auto >  opt 
)

returns a hash for right outer joins with the given arguments

Example With Explicit Join Columns:
*list<auto> rows = table.selectRows(("join": join_right(table2, "t2", ("id": "altid"), ("tag", op_like("offset%")))));
Example With Implicit Join Columns:
(using an automatically detected foreign key to primary key constraint)
*list<auto> rows = table.selectRows(("join": join_right(table2, "t2", NOTHING, ("tag", op_like("offset%")))));
Parameters
table_namethe table to join with
aliasthe alias for table in the query
jcolsthe columns to use for the join, the keys will be columns in the source table and the values are columns in the table argument; if this argument is NOTHING, then if there is any foreign key in one table pointing to the primary key of the other table, then this information is automatically assumed as the join condition; a foreign constraint in the current table to the primary key in table will be used first if it exists
condadditional conditions for the join clause for the table argument; see Where Clauses for more information
optoptional join options (for example, to specify a partition for the join if supported)
Returns
a join description hash corresponding to the arguments for use in the join argument of a select option hash
Since
SqlUtil 1.3

◆ join_right() [4/5]

hash<string, hash<JoinOperatorInfo> > SqlUtil::join_right ( string  ta,
AbstractTable  table,
*string  alias,
*hash  jcols,
*hash  cond,
*hash< auto >  opt 
)

returns a hash for right outer joins with the given arguments for use when joining with a table other than the primary table

Example With Explicit Join Columns:
*list<auto> rows = table.selectRows(("join": join_right(table2, "t2", ("id": "altid"), ("tag", op_like("offset%"))) + join_right("t2", table3, "t3")));
Example With Implicit Join Columns:
(using an automatically detected foreign key to primary key constraint)
*list<auto> rows = table.selectRows(("join": join_right(table2, "t2", NOTHING, ("tag", op_like("offset%"))) + join_right("t2", table3, "t3")));
Parameters
tathe table name or alias of the other table to join with when not joining with the primary table
tablethe table to join with
aliasthe alias for table in the query
jcolsthe columns to use for the join, the keys will be columns in the source table and the values are columns in the table argument; if this argument is NOTHING, then if there is any foreign key in one table pointing to the primary key of the other table, then this information is automatically assumed as the join condition; a foreign constraint in the current table to the primary key in table will be used first if it exists
condadditional conditions for the join clause for the table argument; see Where Clauses for more information
optoptional join options (for example, to specify a partition for the join if supported)
Returns
a join description hash corresponding to the arguments for use in the join argument of a select option hash

◆ join_right() [5/5]

hash<string, hash<JoinOperatorInfo> > SqlUtil::join_right ( string  ta,
Table  table,
*string  alias,
*hash  jcols,
*hash  cond,
*hash< auto >  opt 
)

returns a hash for right outer joins with the given arguments for use when joining with a table other than the primary table

Example With Explicit Join Columns:
*list<auto> rows = table.selectRows(("join": join_right(table2, "t2", ("id": "altid"), ("tag", op_like("offset%"))) + join_right("t2", table3, "t3")));
Example With Implicit Join Columns:
(using an automatically detected foreign key to primary key constraint)
*list<auto> rows = table.selectRows(("join": join_right(table2, "t2", NOTHING, ("tag", op_like("offset%"))) + join_right("t2", table3, "t3")));
Parameters
tathe table name or alias of the other table to join with when not joining with the primary table
tablethe table to join with
aliasthe alias for table in the query
jcolsthe columns to use for the join, the keys will be columns in the source table and the values are columns in the table argument; if this argument is NOTHING, then if there is any foreign key in one table pointing to the primary key of the other table, then this information is automatically assumed as the join condition; a foreign constraint in the current table to the primary key in table will be used first if it exists
condadditional conditions for the join clause for the table argument; see Where Clauses for more information
optoptional join options (for example, to specify a partition for the join if supported)
Returns
a join description hash corresponding to the arguments for use in the join argument of a select option hash

◆ join_right_alias()

hash<string, hash<JoinOperatorInfo> > SqlUtil::join_right_alias ( string  ta,
string  table_name,
*string  alias,
*hash  jcols,
*hash  cond,
*hash< auto >  opt 
)

returns a hash for right outer joins with the given arguments for use when joining with a table other than the primary table

Example With Explicit Join Columns:
*list<auto> rows = table.selectRows(("join": join_right(table2, "t2", ("id": "altid"), ("tag", op_like("offset%"))) + join_right("t2", table3, "t3")));
Example With Implicit Join Columns:
(using an automatically detected foreign key to primary key constraint)
*list<auto> rows = table.selectRows(("join": join_right(table2, "t2", NOTHING, ("tag", op_like("offset%"))) + join_right("t2", table3, "t3")));
Parameters
tathe table name or alias of the other table to join with when not joining with the primary table
table_namethe table to join with
aliasthe alias for table in the query
jcolsthe columns to use for the join, the keys will be columns in the source table and the values are columns in the table argument; if this argument is NOTHING, then if there is any foreign key in one table pointing to the primary key of the other table, then this information is automatically assumed as the join condition; a foreign constraint in the current table to the primary key in table will be used first if it exists
condadditional conditions for the join clause for the table argument; see Where Clauses for more information
optoptional join options (for example, to specify a partition for the join if supported)
Returns
a join description hash corresponding to the arguments for use in the join argument of a select option hash
Since
SqlUtil 1.3

◆ make_jop() [1/2]

hash<string, hash<JoinOperatorInfo> > SqlUtil::make_jop ( string  jop,
AbstractTable  table,
*string  alias,
*hash  jcols,
*hash  cond,
*string  ta,
*hash< auto >  opt 
)

returns hash keyed with the table name assigned to a JoinOperatorInfo hash

Note
this function is normally not used directly, but rather is called by the other SQL Join Operator Functions

◆ make_jop() [2/2]

hash<string, hash<JoinOperatorInfo> > SqlUtil::make_jop ( string  jop,
string  table_name,
*string  alias,
*hash  jcols,
*hash  cond,
*string  ta,
*hash< auto >  opt 
)

returns a hash keyed with the table name assigned to a JoinOperatorInfo hash

This version is used for deferred table resolution at join time

Note
this function is normally not used directly, but rather is called by the other SQL Join Operator Functions