For a join where two tables have the same field name, only one appears in the results

Slightly surprising behaviour here :sweat_smile:

  1. My goal: query and be able to see "id" fields from both tables in a join
  2. Issue: last field with the name wins; only one "id" field is shown
  3. Steps I've taken to troubleshoot: I was able to work around this by explicitly aliasing one of the fields to have a unique name (<tableX>.id AS <x_id>)

This might be expected behaviour, for the purposes of using the data later. It just threw me off during my first exploration :see_no_evil:

Hi @Jon_Hannah,

Apologies for the issue, I am glad you were able to work around this via an explicit alias.

Could you show me screen shot of when the JOIN was only showing one and not two rows that have the same name?

Here's an example query, where two tables both have an id column, but only one appears in the resultset:

Hi @Jon_Hannah,

Thank you for sharing that, I just tested that out and got the same single column results :sweat_smile:

I am guessing we have some buggy code where if two columns have the same name then only the first will show and take president to avoid error messages for column name collisions.

I will report this to our engineering team!

I found a work around, if you give the ID columns in the SELECT cause section of the SQL query their own unique names via aliases then the correct columns will appear!