Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
I have a query summarizing some transaction data that I'd like to summarize by day of week. For my use case, I need to return weekdays formatted according to ISO 8601, so Monday must be the first d...
#1: Initial revision
How do I return ISO day of week in Redshift?
I have a query summarizing some transaction data that I'd like to summarize by day of week. For my use case, I need to return weekdays formatted according to ISO 8601, so Monday must be the first day of the week and Sunday the last day of the week. Postgres/Redshift by default use Sunday as the first day of the week. Thus something like `extract(dow from timestamp 'blah')` returns 0 if blah is a Sunday, and 1 if a Monday. Postgres apparently has an `isodow` argument for exactly this purpose, but it seems like Redshift doesn't support that. Is there a good way to do this other than just wrapping the extract above in a case statement to return the correct values?