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

  • Home
  • SEARCH
  • 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 8729587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:51:34+00:00 2026-06-13T08:51:34+00:00

I have a table and it needs to change Key Value CapacityColdBTU 2000 PowerLevelCold

  • 0

I have a table and it needs to change

Key                  Value
CapacityColdBTU      2000
PowerLevelCold       B
Inverter/Standard    Standard
CapacityColdBTU      1500
PowerLevelCold       B
Inverter/Standard    Inverter

The table should look like below before I use it. I cannot use the table in searching with more than 1 criteria. How do I change it?

CapacityColdBTU   PowerLevelCold    Inverter/Standard
2000              B                 Inverter

Thank you

  • 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-13T08:51:34+00:00Added an answer on June 13, 2026 at 8:51 am

    You can use PIVOT:

    select *
    from
    (
      select [key], value
      from yourtable
    ) x
    pivot
    (
      max(value)
      for [key] in ([CapacityColdBTU], [PowerLevelCold], [Inverter/Standard])
    ) p
    

    See SQL Fiddle with Demo

    Or you can use a CASE statement with aggregate, note this version generates the result you have listed with the Inverter value in the [Inverter/Standard] field:

    select 
      max(case when [key] = 'CapacityColdBTU' 
            then value end) as CapacityColdBTU,
      max(case when [key] = 'PowerLevelCold' 
            then value end) as PowerLevelCold,
      min(case when [key] = 'Inverter/Standard' 
            then value end) as [Inverter/Standard]
    from yourtable
    

    See SQL Fiddle with Demo

    If you have an id or some field that identifies each of these fields with a main record, then you can display the values for each id.

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

Sidebar

Related Questions

I have a table which needs to link one of three seperate tables, but
I have a table which needs to be scrollable within a single page. I've
I have a table row that needs to be hidden when the anchor with
I have an entity which needs fields from another table. The second table is
I have a MySQL Table that looks like this: The SQL to create the
How to update (change from first select table value second) second_table.first_table_id if first_table.email match
I have a need to change ONE PK value in one row of a
We have a table with a key field, and another table which contains the
I have a sqlite table that has amount field with NUMERIC(10,5) value(I know data
I have a SQlite3 table that has typeless columns like in this example: CREATE

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.