Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display data horizontally from DB

Status
Not open for further replies.

Andrzejek

Programmer
Jan 10, 2006
8,530
US

If I have data in TableA:[tt]
ProjectNumber
ABCD[/tt]

TableB:[tt]
ProjectNumber AnotherField
ABCD xyz[/tt]

As long as I have just one (or none) record in TableB, I can ask for this data:
Code:
Select ProjectNumber || ' ' || 
([blue]Select AnotherField from TableB
Where TableB.ProjectNumber = TableA.ProjectNumber[/blue]) As MyProjNo
From TableA
And I get displayed:[tt]
MyProjNo
ABCD xyz[/tt]

But I have this in TableB:[tt]
ProjectNumber AnotherField
ABCD xyz
ABCD ggg
ABCD klm
ABCD opq[/tt]

And I want to have displayed:[tt]
MyProjNo
ABCD xyz ggg klm opq[/tt]

Any ideas?

(Data base is Oracle)


Have fun.

---- Andy
 
I'm sure you could do something, but you might want to ask this specifically in one of the Oracle forums. I've written code in SQL Server to accomplish that exact task a few times, but the code is very proprietary to SQL Server.
 

Thank you, I will post it again in Oracle group.

Have fun.

---- Andy
 

The answer to my question is here for those who want to know.

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top