At 9:09 -0800 1/23/02, Jason Whitlow wrote:
>I am trying to do a select statement but am having problems with the "%" in
>I am trying to
>$sth = $dbh->prepare("SELECT * FROM Years WHERE Date = '2002-%'");
>I just get nothing. No Error messages, nothing. All other sql statements
>work just fine. Is it something with the mysql.pm in regardes to the %
This has nothing to do with Perl or DBD:mysql. You're trying to perform
a pattern match, but that requires the LIKE operator, not a =. So write
the comparison like this:
... WHERE Date LIKE '2002-%'
You might also try this to see if it's faster:
... WHERE Date BETWEEN '2002-01-1' AND '2002-12-31'
>Thanks for any help.
>Senior Network Engineer
>1221 E. Dyer Suite 150
>Santa Ana, CA. 92705