INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

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.

Jobs

One column become multiple column display record

One column become multiple column display record

One column become multiple column display record

(OP)
Hi,

I need display something like this

Here is table User_test

USER_ID ---- NAME
1 ------------- ADAM
2 ------------- BABY
3 ------------- CATTY
4 ------------- DOGGY
5 ------------- ELLE
6 ------------- FLURRY

i want the record display like this
GroupA ----- GroupB -------GroupC
ADAM -------CATTY --------ELLE
BABY --------DOGGY --------FLURRY


but i try to write query like this

SELECT
(SELECT B.NAME FROM USER_TEST B WHERE B.NAME=A.NAME AND B.NAME IN ('ADAM','BABY') ) AS Group_A,
(SELECT C.NAME FROM USER_TEST C WHERE C.NAME=A.NAME AND C.NAME IN ('CATTY','DOGGY') ) AS Group_B,
(SELECT C.NAME FROM USER_TEST C WHERE C.NAME=A.NAME AND C.NAME IN ('ELLE','FLURRY') ) AS Group_C
FROM USER_TEST A


but it display like this hammer hairpull

GroupA ------- GroupB -------GroupC
ADAM -------------------------------
BABY --------------------------------
---------------CATTY --------------
---------------DOGGY ---------------
--------------------------------ELLE
--------------------------------FLURRY



Any advise ? cry

RE: One column become multiple column display record

(OP)
Hi, PHV

tq very much your solution bigsmile

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!

Resources

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