SQL Views are way cool.
It’s not that I didn’t know what they were or how they worked. I just never actually saw a need to implement one until this week. But now I have, and I’ve realised they’re even cooler than I thought.
I was working with complicated query on the Perth Festival site, for working out individual event instances with event details, dates and seasons, categories and venues – 67 cfquery lines (ok, so I space my SQL out) and seven tables, down to 16 lines and 1 view. Beauty!
I can’t believe I didn’t use them before.