Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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)".


Wow, 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.


True 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.


I'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


In 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#i...

http://prestodb.io/docs/current/functions/aggregate.html#cou...


Ooohh. I hadn't seen that one. That's going to make things so much better for the accounting code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: