in reply to Re: Merging Results from 3 different queries
in thread Merging Results from 3 different queries
I was then able to get the data back out of the hash but it did not maintain the data order (columns) that I get when running the straight SQL. Perhaps using the selectall_hashref may not be the answer. If people have other suggestions for options, feel free to pass them along.for my $id ( sort keys %{ $hashref1 } ) { ## extract an array of results for that key from each hash my %results1 = %{ $hashref1->{ $id } }; my %results2 = %{ $hashref2->{ $id } }; my %results3 = %{ $hashref3->{ $id } }; ## join them together with spaces ## and print them along with the key printf "%14s : %s \t%s\t%s\n", $id, join( ' ', %results1 ), join( ' ', %results2 ), join( ' ', %results3 ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Merging Results from 3 different queries
by BrowserUk (Patriarch) on Jul 24, 2007 at 17:46 UTC | |
by MegaVoice (Novice) on Jul 24, 2007 at 18:02 UTC | |
by BrowserUk (Patriarch) on Jul 24, 2007 at 18:40 UTC |