Close
Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

LABS
[Standup][Boulder] 9/5/12 – Don't judge before you typecast

Helps

  • What is the fastest way to use a calculated column in a where clause with postgres?
SELECT (column1 + column2) AS super_column WHERE super_column > 1

Solutions:

  • use a sub query in the FROM
  • duplicate the logic for the calculated column

Like Woah

  • _before_type_cast lets you get to attributes of a model before they are type cast, useful for validations and calculations.

Comments
Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *