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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:50:54+00:00 2026-05-30T05:50:54+00:00

Something is wrong with my MySQL query below but I can’t find the problem.

  • 0

Something is wrong with my MySQL query below but I can’t find the problem. It’s not returning any errors but the query below should return 1 row, but it returns none.

The table ‘fws_product’ contains all products. The table ‘webits_product_has_kenmerken’ contains the product specifications.

SELECT fws_product.* 
FROM webits_product_has_kenmerken 
LEFT JOIN fws_product ON webits_product_has_kenmerken.product_id = fws_product.ID 
WHERE fws_product.CATID = 11 
AND ( 
(webits_product_has_kenmerken.kenmerk_id = 8 AND webits_product_has_kenmerken.kenmerk_value = 'Buddha to Buddha') 
AND
(webits_product_has_kenmerken.kenmerk_id = 19 AND webits_product_has_kenmerken.kenmerk_value = '10 mm')
)

Thanks in advance!

  • 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-30T05:50:55+00:00Added an answer on May 30, 2026 at 5:50 am

    It looks a bit nasty, but the following should do as you have requested

    SELECT
        p.*
    FROM fws_product AS p
    
    INNER JOIN webits_product_has_kenmerken AS ps8 
        ON ps8.product_id = p.ID
        AND ps8.kenmerk_id = 8
        AND ps8.kenmark_value = 'Buddha to Buddha'
    
    INNER JOIN webits_product_has_kenmerken AS ps19 
        ON ps19.product_id = p.ID
        AND ps19.kenmerk_id = 19
        AND ps19.kenmark_value = '10 mm'
    
    WHERE p.CATID = 11
    

    This is another potential option which may do the job, but still feels very nasty

    SELECT
        p.*
    FROM fws_product AS p
    INNER JOIN (
        SELECT 
            product_id,
            COUNT(*) AS numMatches
        FROM webits_product_has_kenmerken
        WHERE (kenmerk_id,kenmerk_value) IN (
                (8,'Buddha to Buddha'),
                (19,'10 mm')
            )
        GROUP BY product_id
        HAVING numMatches = 2
    ) AS ps
    ON ps.product_id = p.ID
    
    WHERE p.CATID = 11
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I may be doing something wrong, but I haven't been able to find a
I currently have the following MySQL query, which executes fine without any errors: SELECT
I have the below MySQL query, which should return the t1.username , t1.website ,
Am I doing something wrong or is it not possible to specify a generic
There's something wrong with my code or I'm just not understanding this fully. I
I must be doing something wrong. I can't seem to execute my CustomValidator's ServerValidate
Maybe I'm doing something wrong but I have a textarea where I've specified textAlign
There is something wrong with this trigger. But what? CREATE TRIGGER MYCOOLTRIGGER AFTER INSERT
I am using the below code to search a mysql database but cannot get
I tried to truncate a table but why is it not working? must something

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.