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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:59:55+00:00 2026-06-10T21:59:55+00:00

I have a mysql table like this PRODUCT ——- product_id: 1 | name: product

  • 0

I have a mysql table like this

PRODUCT
-------
product_id: 1 | name: product .... product_id: 2 | name: product2 .. etc etc

then i have another table

PROPERTY
---
id: 1 | name: red | product_id: 1 .... id: 2 | name: large | product_id: 1 ..... id: 3 | name : brown | product_id: 2 .... and so on ...

How can i select a product with 2 property?

For example i want to take a product with RED and LARGE property

i tried

SELECT * FROM product
JOIN property USING (product_id)
WHERE property.name = "red" AND property.name = "large" ....

but obviusly it doesn’t work 🙂

thanks for the help and sorry for my english!

  • 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-10T21:59:57+00:00Added an answer on June 10, 2026 at 9:59 pm

    you need to count its instances of its record

    SELECT  a.productname
    FROM    product a
            INNER JOIN property b
                on a.product_ID = b.product_ID
    WHERE b.name IN ('red', 'large')
    GROUP BY a.productname
    HAVING COUNT(a.productname) = 2
    

    if you click the demo, you can see the differences between grouping the result and by regular filetering using IN

    SQLFiddle Demo

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

Sidebar

Related Questions

I have a MySQL table structured somewhat like this: type name value ===================== 1
I have a product order table in mysql. It's like this: create table `order`
I have a mysql code like this... INSERT INTO `product` (`product_id`, `model`, `sku`) VALUES
I have a MySQL table like this: Payments +----+---------------------+---------+ | id | date (sorted
I have a MySQL table looking like this: > describe books; +---------------+--------------+------+-----+---------+----------------+ | Field
I have a mysql table that looks like this: id col2 col3 col4 1
I have a MySQL table that looks like this: `id` int(10) unsigned NOT NULL
I have this mysql table called comments which looks like this: commentID parentID type
I have a MySQL table that looks something like this: +-----+------------+ | id |
I have a mySQL table that has a column like this: ID ----- 0352

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.