|
|
|
|
|
by dragonwriter
1002 days ago
|
|
> For the second — `USING` isn’t fully equivalent to `ON`. In terms of portability because its not supported by, e.g., MSSQL, sure. In terms of its semantics, though: t1 [LEFT/RIGHT/INNER] JOIN t2 USING col
Is fully equivalent to: t1 [LEFT/RIGHT/INNER] JOIN t2 ON (t1.col == t2.col)
So for a comparison to SQL as used by most RDBMSs (rather than MSSQL specifically), rather than “what should PRQL compile to”, USING is quite appropriate.It may be that the intent of the homepage pairing is to highlight the actual compilation result and not provide a comparison to SQL-as-it-would-manually-be-written, but the presentation doesn’t make it clear that that’s the purpose. |
|
To take one point from there:
> Is fully equivalent to:
They're not fully equivalent — `USING` combines the two columns into a single column, `ON` doesn't.