Is this an obvious problem?

Results 1 to 2 of 2

Thread: Is this an obvious problem?

  1. #1
    Join Date
    Dec 1969

    Default Is this an obvious problem?

    I have the following sql statement..<BR><BR>SELECT PRICE_LST_DTL.*, PRODUCT_NO_MSTR.FREE_STOCK_BAL, PRODUCT_NO_MSTR.PROD_NO, PRODUCT_NO_MSTR.short_description, NA_Trade_manufacturer.*, NA_Trade_product.*, NA_Trade_department.*,upper(substring(NA_Trade_man ufacturer.manufacturer_name,1,1)) first_letter FROM NA_Trade_manufacturer INNER JOIN NA_Trade_product ON NA_Trade_manufacturer.manufacturer_id = NA_Trade_product.manufacturer_id INNER JOIN NA_Trade_department ON NA_Trade_product.department_id = NA_Trade_department.department_id INNER JOIN PRODUCT_NO_MSTR ON NA_Trade_product.short_description = PRODUCT_NO_MSTR.short_description INNER JOIN PRICE_LST_DTL ON PRODUCT_NO_MSTR.PROD_NO = PRICE_LST_DTL.PROD_NO WHERE PRODUCT_NO_MSTR.FREE_STOCK_BAL&#062;&#039;0&#039; and NA_Trade_product.build_product=&#039;N&#039; AND (NA_Trade_manufacturer.manufacturer_id = 132) AND (( LIKE &#039;%%&#039;) OR (NA_Trade_product.sku LIKE &#039;%%&#039;) OR (NA_Trade_product.Supplier_code LIKE &#039;%%&#039;) OR (NA_Trade_product.Product_Keywords LIKE &#039;%%&#039;)) ORDER BY NA_Trade_manufacturer.manufacturer_name, <BR><BR>this should result in 2 products being found..the right two products are found but it is showing each product 17 times so it says 34 products found..then loads the same two products 17 times for some reason..anything obvious? thanks

  2. #2
    Join Date
    Dec 1969

    Default Yes it is...

    the problem is one or more of the inner joins.<BR>To find the error reduce the size of the SQL statement:<BR>Put just one inner join and check what you got. Then add another inner join and check what you got.. you will notice the error quickly (maybe in the next 15-20 minutes)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts