3 ms·
Looking forward to when we move to 9.4 so I can start using "sum(foo) FILTER (WHERE bar)" instead of the ugly "sum(CASE WHEN bar THEN foo END)".
by jeltz 12y ago
Looking forward to when we move to 9.4 so I can start using "sum(foo) FILTER (WHERE bar)" instead of the ugly "sum(CASE WHEN bar THEN foo END)".
- wvenable 12y agoWow, that's fantastic. My queries are littered with that type of construct. Unfortunately, we are using SQL Server and Microsoft hardly ever makes any developer-friendly enhancements to T-SQL.
- tracker1 12y agoTrue enough... I can't even begin to wrap my head around the XML wrangling functions in T-SQL, I feel like a n00b copying JS methods for jQuery when I go there. That said, it's probably one of the easiest RDBMS servers to administrate for small-medium sized deployments.
- sarciszewski 12y agoI've written migration unit testing tools before between SQL Server and PostgreSQL specifically (there are specific gotchas between the two). If you need help migrating to PGSQL send me an email and I'll help you escape from MSSQHell. :D
- wiredfool 12y agoOoohh. I hadn't seen that one. That's going to make things so much better for the accounting code.
- electrum 12y agoIn Presto, we support the popular but non-standard IF construct as a shorthand for CASE, so you can do this: sum(if(bar, foo)) We also have a count_if() function: count_if(bar) http://prestodb.io/docs/current/functions/conditional.html#if http://prestodb.io/docs/current/functions/conditional.html#i... http://prestodb.io/docs/current/functions/aggregate.html#count_if http://prestodb.io/docs/current/functions/aggregate.html#cou...