Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6342467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:14:45+00:00 2026-05-24T20:14:45+00:00

I have a table like this, EmpID EmpName Age DOB 123 user 43 30/06/85

  • 0

I have a table like this,

EmpID  EmpName  Age  DOB
123    user     43   30/06/85
122    user1    42   31/07/86

I need a out put in this format,

Column1  Column2  Column3
EmpID    123      122
EmpName  user     user1
Age      43       42
DOB      30/06/85 31/07/86

And note the number of columns in table A will keep on increasing, so if I use unpivot to achieve this, I cannot hard code the column names.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:14:46+00:00Added an answer on May 24, 2026 at 8:14 pm

    See this post on pivots with dynamic columns. http://www.sqlprof.com/blogs/sqldev/default.aspx

    btw, for my own bias, I’m assuming SQL server but it would be helpful in future to tag the specific DBMS you’re using

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a table Employee like this EmpID, EmpName 1 , hatem
I have a table like this, with three fields: User | Question# | Answer
I have table like this: +------+-------+ | user | data | +------+-------+ | 1
I have table like this -> http://jsfiddle.net/jurisKaste/FvgeQ/ And I need to get array of
I have a table called Orders in which the data looks like this: EMpID
I have a table like this swipe_details EMPID EVENT_TYPE Swipe_time 1 EN 2012-06-01 12:00
Let us say that I have a table structured like this(using SQL server): empID
I have table like this : ID Name_1 Name_2 Name_3 1 Egon Spengler Ives
I have a table like this ID Name IsDeleted 1 Yogesh Null 2 Goldy
I have a table like this : +-------+------------+------+-----+---------+-------+ | Field | Type | Null

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.