Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Getting length of longest value in a column

by repellent (Priest)
on Feb 21, 2012 at 04:05 UTC ( #955220=note: print w/ replies, xml ) Need Help??


in reply to Getting length of longest value in a column

Have the database do the work for you:

my $query = <<'SQL'; SELECT ticket_id, abstract, priority, maxlen_abstract FROM (SELECT MAX(LENGTH(abstract)) AS maxlen_abstract FROM t1) AS s1 CROSS JOIN t1; SQL

Pay special attention to what your definition of length should be. You may not be in an ASCII-world.


Comment on Re: Getting length of longest value in a column
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (17)
As of 2015-07-29 20:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (268 votes), past polls