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 7947381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:24:52+00:00 2026-06-04T01:24:52+00:00

I have the following table ID p_name p_value —- —— ————– 1 name index.htm

  • 0

I have the following table

    ID    p_name     p_value
   ----   ------     --------------
    1      name       index.htm
    1      path       c:\web\site1
    1      size       400
    1      date       2011-03-12
    1      note       'test site'
    2      name       login.htm
    2      path       c:\web\site1
    2      size       500
    ...    ...        ...
    ...    ...        ...

I need to make it look like this

    ID   Name         Path
   ---   ----------   -------------
    1     index.htm    c:\web\site1
    2     login.htm    c:\web\site1
    ...   ...          ...

I was reading few other posts, but I could not figure out how to apply it on my example!
I just need mainly the “Name” and the “Path” and I may add others when needed!

  • 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-06-04T01:24:53+00:00Added an answer on June 4, 2026 at 1:24 am

    Simplest way is to case it out since it seems you have a finite number of p_names for a given ID.

    Attempt 2 – revised

    Select ID, T1.P_Name as Name, T2.P_value as Path
    FROM YourTableName T1
    INNER JOIN yourTableName T2 
      ON T1.ID = T2.ID 
      and T1.P_Name = 'name' 
      and T2.P_name = 'path'
    

    Attempt 1 – Blunder

    SELECT Id,
    CASE p_name when 'name' THEN P_value end as Name,
    CASE p_name when 'path' THEN p_value end as Path
    FROM yourTableNameHere
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: <table id=box-table-a class=tablesorter> <thead> <tr> <th scope=col>B-House/Dorm Name</th> <th
I have following xml file: <ab> <![CDATA[ <table> <tbody> <tr> <th>abcdef</th> </tr> <tr> <p>
I have following table Id | Status | date ------------------- 1 | Onsite |2007
I have the following table structure (in MySQL): DocID, Code, IsDup, DopOf , where
I have the following table. When i try to insert records using LINQ to
I have the following table of TIME datatypes clarification: I am representing hours/mins/seconds of
I have the following table EVENT_LOG : EVENT_ID: pk, int, not null TYPEID: fk,
I have the following table: mysql> SELECT * FROM `bright_promotion_earnings`; +----+----------+------------+----------+-------+ | id |
I have the following table: UID | Limit |Type 8 | 4 |A 8
I have the following table variable in SQL Server 2005: DECLARE @results TABLE (id

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.