Question

Joins with `USING` instead of `ON`

  • 27 March 2019
  • 1 reply
  • 61 views

Is there any way to utilize a USING join clause in Looker joins instead of ON?


select id, tableA.fieldA, tableB.fieldB

from tableA

inner join tableB using(id)


My team has put in a lot of effort to model our data with dbt. As a result, we are somewhat consistent with our column names, and ON joins with different column names aren’t always needed. We are using BigQuery StandardSQL if that is relevant.


1 reply

Userlevel 7
Badge +1

My reply here explains how to do this:



Basically, you can use the sql: parameter instead of sql_on: to override the automatically generated join SQL and use whatever is input there— So you could use your “using” there!

Reply