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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:07:44+00:00 2026-06-12T22:07:44+00:00

so there is a table of parameters which is associated with the "offer". The

  • 0

so there is a table of parameters which is associated with the "offer". The parameters table looks like this:

  • offer_id
  • parameter_name
  • parameter_value

Table entries look like this:

offer_id | parameter_name | parameter_value

1 | price | 100

1 | width | 150

1 | height | 200

1 | place | left

1 | place | right

2 | price | 300

2 | width | 150

2 | height | 200

Now I want to perform a search using MySQL query in this table, where

  • price is more than 80 AND less than 120
  • width is equal to 150
  • height is equal to 200
  • place is either left OR right

The expected outcome:

  • offer_id = 1

How would a MySQL query look like?

Thanks a lot.

  • 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-12T22:07:45+00:00Added an answer on June 12, 2026 at 10:07 pm

    Something like this:-

    SELECT *
    FROM offers a
    INNER JOIN offers b ON a.offerid = b.offerid
    INNER JOIN offers c ON b.offerid = c.offerid
    INNER JOIN offers d ON c.offerid = d.offerid
    WHERE a.parameter_name = 'price'
    AND b.parameter_name = 'width'
    AND c.parameter_name = 'height'
    AND d.parameter_name = 'place'
    AND a.parameter_value BETWEEN 80 AND 120
    AND b.parameter_value = '150'
    AND c.parameter_value = '200'
    AND d.parameter_value IN ('left','right')
    

    Note that this will bring back multiple rows sometimes (ie id of 1 would come back more than once). You can remove this with a DISTINCT if you want. Depends how the data is to be used.

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

Sidebar

Related Questions

i have a t_class table in mySql, in this table there are 3 columns,
I'm trying to execute a query like this: SELECT * FROM table WHERE id
I have a table in which there is one column named: 'eZip' (varbinary(5), null).
There is a problem in which i have to update a table with millions
Is there a way for CONTAINS to have, Column names as both parameters like
I have a table of items, each of which has a date associated with
Is there an equivalent to Oracle's describe_procedure (which returns resultset of all parameters) for
Is there a table i can query all of Oracle Reserved Words? Example, i
in a Table there is a single attribute(column).it contains numbers.Some are repeated(2 or 3
in an sql table there's an id, first name and last name field. i'd

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.