Anti-nuisance lawsuit warning: The purpose of these notes is to remind me, Zoegond, of stuff or to help me work stuff out. They may contain mistakes.

Quick

  • ($a, $b....) = unpack("A2A7...", $packed)
  • push( array, list )

Friday, February 4, 2011

SQL case

The short form of case -

case field when x then y when z then w else v end

appears to do a comparison with =. This means that a clause 'when null then...' will always be false, for the usual reason that any expression (other than is) involving null returns null.

Where null is one of the switch values, you must use the long form

case when field = x then y when field is null then w else v end

Followers

Blog Archive