Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Syntactic Confectionery Delight
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

I'm talking of 125 days of course, but this is not relevant here cause the "problem" is not in the data type, it is in the equation doing the comparison. Incidentally we are talking about a time here, but will be the same using any type of data that can be converted to a number, and that you can sum later to other number.

if:  (X + 5) < (Y + 4) then: X + 1 < Y

And all of this leads us to this more compact and probably more desirable form of the query:

=code my $sql = $dbh->exec_select("SELECT acc,name,date FROM mytable WHERE name != '' AND CURDATE() BETWEEN date + 125 DAYS and date + 365 DAYS AND date BETWEEN '2010-11-11' and '2011-11-11' AND controlnum IN ('00988777','009999','12345','77766','88776','998888 +','2222333','2223999','8877788','9988877','9988888','9998877','999888 +8','9999888','11220000','11223756','22339668','22388577','23334455',' +77665555','88877777','112223333','222339000','223445988','223475699', +'666555555','887777654','88777766666','888777666666') order by date desc"); =cut

In reply to Re^8: For a better efficiency and speed question! by pvaldes
in thread For a better efficiency and speed question! by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (8)
    As of 2014-04-16 04:26 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      April first is:







      Results (413 votes), past polls