in reply to Problem with case in select statement
BTW, it is helpful to us and you if you format the SQL statement to make it more readable. I don't really like using indentation for SQL but always put each clause on a separate line. I tend to use here-docs to assign to a $sql variable and then prepare with the variable.
my $sql=<<END_HERE; SELECT foo FROM bar WHERE baz = ? END_HERE my $sth = $dbh->prepare($sql);
|
|---|