Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: For a better efficiency and speed question!

by pvaldes (Chaplain)
on Oct 04, 2011 at 15:42 UTC ( #929580=note: print w/ replies, xml ) Need Help??


in reply to For a better efficiency and speed question!

This is wrong:  Select name ... WHERE mame<>''


Comment on Re: For a better efficiency and speed question!
Download Code
Re^2: For a better efficiency and speed question!
by Anonymous Monk on Oct 04, 2011 at 15:46 UTC
    "...WHERE mame" just typed it wrong, but it is ...WHERE name <> '', name is not equal do empty.

      ... two times, your sql is malformed

      =code my $sql = $dbh->exec_select("SELECT acc,name,date FROM mytable WHERE m +ame<>''

      and same problem after the my $control_num line

        AND ((date + 125 DAYS) < CURRENT_DATE)

        The same as this but more easy to calculate

        AND ((date + 1 YEAR) < (CURRENT_DATE + 240 DAYS) )
        What is wrong with this code?
        =code my $sql = $dbh->exec_select(" SELECT acc, name,date FROM mytable WHERE name <> '' AND ((date + 1 YEAR) >= (CURRENT_DATE)) AND ((date + 1 YEAR) < (CURRENT_DATE + 240 DAYS)) AND controlnum IN ('12345','8877788','23334455','223445988','222339000 +','2222333','223475699','22339668','2223999','009999','11220000','777 +66','88776' ,'9988888','11223756','22388577','9998888','998888','77665555','999988 +8','88877777','666555555','88777766666','112223333','9998877','998887 +7' ,'888777666666','00988777','887777654') and date between '2010-11-11' and '2011-11-11' order by date desc"); =cut
        If you show where you see the error it would help! Thanks

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://929580]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2014-11-25 00:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (148 votes), past polls