Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coalesce statements in models/staging/stg_products.sql fail in MSSQL #44

Open
ssugar opened this issue May 8, 2024 · 0 comments
Open

Comments

@ssugar
Copy link

ssugar commented May 8, 2024

Coalesce statements don't work in MSSQL - they may only work in postgres I think (although I could be wrong there).

Example:

coalesce(type = 'jaffle', false) as is_food_item

This results in an invalid syntax at '=' error.

I can fix this by adjusting the model to use a case statement like this:

case when type = 'jaffle' then 'true' else 'false' end as is_food_item

maybe wrap this up in a macro that can be overriden based on the adapter (like the cents_to_dollars macro?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant