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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:34:01+00:00 2026-06-14T05:34:01+00:00

I have the following set of tables with the attached query. Evidently, I’m stuffing

  • 0

I have the following set of tables with the attached query. Evidently, I’m stuffing too many AND clauses into this and now no results are valid even though are results. Shown below are the Diagram and SQL I’m using.

MySQL Database Model-hidden fields aren't vital.

SELECT p.products_id, pd.language_id, pd.products_name,
       pd.products_description, pd.products_url, p.products_quantity,
       p.products_model, p.products_image, p.products_price, p.products_virtual,
       p.products_weight, p.products_date_added, p.products_last_modified,
       p.products_date_available, p.products_status, p.manufacturers_id,
       p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute,
       p.product_is_free, p.product_is_call, p.products_quantity_mixed,
       p.product_is_always_free_shipping, p.products_qty_box_status, p.products_quantity_order_max, p.products_sort_order, 

FROM `magez_products` p, `magez_products_description` pd
       WHERE p.products_id = pd.products_id
       AND p.products_id = 186
       AND p.products_id = cfv.products_id 
       AND cfv.nation_id = cfvn.nation_id
       AND cfv.clan_id = cfvc.clan_id
       AND cfv.rarity_id = cfvr.rarity_id
  • 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-14T05:34:03+00:00Added an answer on June 14, 2026 at 5:34 am

    To help, I too was old-school ANSI format… You’ll find more current queries written using JOINS between the tables and only apply the “AND” where you actually want to “restrict”. Sometimes, this could be directly at the join instead of the primary “from” table. Also, by doing as a join, you see exactly how table “A” connects to table “B”, and I try to keep the A = B comparison in the same sequence as the tables are listed… Left-side table on left side of =, right-side table on right side of = such as

    SELECT 
          p.products_id, 
          pd.language_id, 
          pd.products_name,
          pd.products_description, 
          pd.products_url, 
          p.products_quantity,
          p.products_model, 
          p.products_image, 
          p.products_price, 
          p.products_virtual,
          p.products_weight, 
          p.products_date_added, 
          p.products_last_modified,
          p.products_date_available, 
          p.products_status, 
          p.manufacturers_id,
          p.products_quantity_order_min, 
          p.products_quantity_order_units, 
          p.products_priced_by_attribute,
          p.product_is_free, 
          p.product_is_call, 
          p.products_quantity_mixed,
          p.product_is_always_free_shipping, 
          p.products_qty_box_status, 
          p.products_quantity_order_max, 
          p.products_sort_order
       FROM 
          magez_products p
             JOIN magez_products_description pd
                on p.products_id = pd.products_id
             JOIN magez_cfv_cards cfv
                on p.products_id = cfv.products_id
                JOIN magez_cfv_nations cfvn
                   on cfv.nation_id = cfvn.nation_id
                JOIN magez_cfv_clans cfvc
                   on cfv.clan_id = cfvc.clan_id
                JOIN magez_cfv_rarity cfvr
                   on cfv.rarity_id = cfvr.rarity_id
       where
          p.products_id = 186
    

    Notice the formatting I have, it correlates to your table structures… A joined to B, B joined to C, D and E on respective columns. The WHERE clause is simple on the exact criteria you want…

    Now, if you only wanted certain other elements, you can just add your “AND” to that component’s JOIN criteria.

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

Sidebar

Related Questions

I have the following query: SET @q = 12; UPDATE `table` SET qty =
I have the following result set from a join of three tables, an articles
Let's says I have a set of tables that match the following scenario: Crates
I have the following XML: <?xml version="1.0" encoding="UTF-8"?> <Data> <Set> <Tables> <Table> <Tablehead> <C>Name</C>
I have got a set of tables like the following A ---- B_has_A ----
I have the following set of tables in an existing database. Resource - ResourceID
I have the following sample data set in one of my tables: sub1.domain.com domain.com
I have following SQL UPDATE query: UPDATE Invoices SET Price = (SELECT SUM(Price*ProductsAndServices.Amount) FROM
I have following code to insert data into GiftCouponPayment table and Payment table. This
I quite often have rows of code like the following: UPDATE my_table SET name

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.