CROSSJOIN

Consider CROSSJOIN(S1, S2). This can be expanded as follows:

  1. Make a table out of the sets S1 and S2. If a set is literal (that is, its members are explicitly enumerated), then you make this table as shown in "Literal Sets." If it is the result of an expression, look at the section dealing with that expression to see how to get the table.

  2. The following query performs the CROSSJOIN operation:
    SELECT S1.*\Rank, S2.*\Rank, Newrank AS Rank
    FROM (SELECT S1.*\Rank, S2.*\Rank FROM S1, S2)
    RANK ROWS AS NewRank RANKORDER BY Rank1, Rank2
    

    The notation “S1.*\Rank” means “All columns of S1, minus the Rank column.”