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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:26:04+00:00 2026-05-21T07:26:04+00:00

I’m a database newb, so please forgive me if this has been covered a

  • 0

I’m a database newb, so please forgive me if this has been covered a million times before, I’m not finding a solution for what I’m trying to do.

I have a table – we’ll call ‘product_attributes’, where a number of specific attributes are stored for all the products. In this table, ‘attribute_id’ tells me what type of information is stored in the row, ‘store_id’ tells me which website the information is displayed on, ‘entity_id’ tells me what product the information is about and ‘value’ is information about the product. Format is:

value_id    entity_type_id    attribute_id    store_id    entity_id    value
1221        4                 57              0           306          Detailed Description of Product
1222        4                 58              0           306          Quick Overview of Product
1223        4                 68              0           306          metakeywords
1224        4                 89              0           306          metadescription
1225        4                 93              0           306          Other Stuff
1226        4                 57              0           307          Detailed Description of Product
1227        4                 58              0           307          Quick Overview of Product
1228        4                 68              0           307          metakeywords
1229        4                 89              0           307          metadescription
1230        4                 93              0           307          Other Stuff

I need to run a query to pull all items from the column ‘value’ with ‘attribute_id=57’ into a column called ‘Long Description’ and all items from the same column with ‘attribute_id=58’ into another column called ‘Short Description’. I can get the values individually easy enough with:

SELECT product_attributes.value FROM product_attributes WHERE attribute_id=57

or

SELECT product_attributes.value FROM product_attributes WHERE attribute_id=58

But I need a separate column for each like this:

Long Description                      Short Description
Detailed Info of 'entity_id 306'      Overview of 'entity_id 306'
Detailed Info of 'entity_id 307'      Overview of 'entity_id 307'
  • 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-21T07:26:05+00:00Added an answer on May 21, 2026 at 7:26 am
    SELECT pr1.value as LongDescription, pr2.value as ShortDescription 
    FROM product_attributes pr1 
    JOIN product_attributes as pr2 
    WHERE pr1.attribute_id=57 AND pr2.attribute_id=58
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

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.