Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Efficient Data Comparison

by dokkeldepper (Friar)
on Dec 20, 2005 at 10:07 UTC ( [id://518007]=note: print w/replies, xml ) Need Help??


in reply to Efficient Data Comparison

The best choice would be to let the database do it for you. Consequently, I agree with my predecessors, that this is merely a sql related problem.

The join

select <do sth useful here> from table a inner join table b on a.date<b.date inner join table c on b.date<c.date

(and so on) will do it for you.

Because your tables are small it should be quite fast. An iterative perl solution would be possibly less efficient, not to mention the required connection overhead. If you have to do it regularly create a view. In case your database has a join problem google for 'correlated subqueries'.

I use perl in such circumstances for automatic creation of these annoying statments.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-19 10:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found