×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Display data horizontally from DB

Display data horizontally from DB

Display data horizontally from DB

(OP)
   
If I have data in TableA:
ProjectNumber
ABCD


TableB:
ProjectNumber    AnotherField
ABCD             xyz


As long as I have just one (or none) record in TableB, I can ask for this data:

CODE

Select ProjectNumber || ' ' ||
(Select AnotherField from TableB
Where TableB.ProjectNumber = TableA.ProjectNumber
) As MyProjNo
From TableA
And I get displayed:
MyProjNo
ABCD xyz


But I have this in TableB:
ProjectNumber    AnotherField
ABCD             xyz
ABCD             ggg
ABCD             klm
ABCD             opq


And I want to have displayed:
MyProjNo
ABCD xyz ggg klm opq


Any ideas?

(Data base is Oracle)
 

Have fun.

---- Andy

RE: Display data horizontally from DB

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.

RE: Display data horizontally from DB

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

Have fun.

---- Andy

RE: Display data horizontally from DB

have you tried a crosstab type query?

RE: Display data horizontally from DB

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

Have fun.

---- Andy

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close