Home » SQL & PL/SQL » SQL & PL/SQL » Multiple Selects One Report (Oracle 10g)
Multiple Selects One Report [message #361495] Wed, 26 November 2008 11:59 Go to next message
pcd_lou
Messages: 63
Registered: October 2007
Location: Florida
Member
Hey Guys...

I have a need to read sequentially through a table (with selection) and get columns from other tables and reformat things like name/address. I've got that working fine.

But now, when I come to a break (group of rows), I need to use a different table to drive the selection but use the same other columns fro the first select and reformat these columns again.

Is there a way to put all this reformating into a sub-routine so I can run through it from either select and have only one copy of the reformatting code in the program?

Any help would be greatly appreciated.

Thanks,
Lou
Re: Multiple Selects One Report [message #361496 is a reply to message #361495] Wed, 26 November 2008 12:05 Go to previous messageGo to next message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Do it in one SQL statement.

Regards
Michel
Re: Multiple Selects One Report [message #361498 is a reply to message #361496] Wed, 26 November 2008 12:09 Go to previous messageGo to next message
pcd_lou
Messages: 63
Registered: October 2007
Location: Florida
Member
Michel,

Thanks for the quick reply. I do have a third selection to do after the second one is done. But still on the same break from the first selection.

How can I do this selection with Left Join on one table and/or the other table and/or the other table?

Any ideas?

Thanks,
Lou
Re: Multiple Selects One Report [message #361545 is a reply to message #361495] Wed, 26 November 2008 22:36 Go to previous message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member


Not pretty clear on your requirement.

Please Post create and insert table script to reproduce the issue and required output.

Smile
Rajuvan.


Previous Topic: MAX() Returning Wrong Values
Next Topic: Display rows according to specific conditions in resultset
Goto Forum:
  


Current Time: Tue Dec 06 16:22:50 CST 2016

Total time taken to generate the page: 0.09093 seconds