Jump to content

Extract data from multiple sources, concatenate it together, and sort it...


iainr

Recommended Posts

Hi Guys,

 

Attempting to do something which I'm not sure is possible (at least how I'm currently doing it). I'll try to explain as best I can.

 

I've got several different databases, lets say one stores information about people, one about trees and one about computers. The information in them is pretty unrelated, but each has a field saying when any record was last updated.

 

At the moment I'm extracting a list of all records in 'people' updated after a certain date (then printing them out), all records in 'trees' modified after a certain date (and printing them out), and the same for 'computers'. I want to sort the records by 'date_updated' as well - but if I sort each record set as it is extracted (using ORDER BY) I simply get people, trees and computers all separately printed out but individually sorted by date_updated.

 

What I'd like is a big list of records from all three databases, universally sorted by the 'date_updated' field, so the records could be all muddled up but in the correct order of date_updated.

 

I've attempted to feed the data into arrays but then realised if I sort one array the others wont follow suit and the data wont match any more,

 

Any advice on this is appreciated - also if it doesn't make sense I can try to explain again,

 

Thanks!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.