Selecting a column named "delete" in the dbt query to create a Staging VIEW

I am trying to create a VIEW in dbt. The source table has a column named delete. How do I select this column in the select query in DBT?

I tried :

select id, delete from src_table;
select id, "delete" from src_table;

but neither of them worked. Please advise.

What underlying database are you using?

Hi @neil.strange . Snowflake.

Happens if you upcase too?

A colleague helped figure this out. In addition to having the delete in double quotes, need to have a model YAML as following:

version: 2

models:
  - name: model_name
    columns:
      - name: delete
        quote: true

once this yaml definition is created, select id, "delete" from src_table should work.

1 Like