in reply to MySQL undef

If you're using MySQL, is there any particular reason why you need to abstract and make this unreadable?

$query = ' SELECT span, MAX(ts) AS ts FROM my_table GROUP BY span';

Takes like 15 seconds to type that, and it's far more intuitive.

Replies are listed 'Best First'.
Re^2: MySQL undef
by Anonymous Monk on Mar 04, 2012 at 18:18 UTC
    Agree. If a simple SQL query is what you are actually doing then just do that. Nothing could be easier to understand, debug or read. Yes there are places for DBIx and I have used it extensively, but trivial cases are not "it."