1

以下のようにクエリを実行すると、「一意ではないテーブル/エイリアス:」「PRICE」が表示されます。何時間も試した後、私はそれに固執しています!(これは変更されたMS SQLクエリです)

SELECT
    PRICE_GENERIC.`Part Description` AS post_title,
    `PRICE_GENERIC`.`Part Description` AS post_name,
    PRICE_GENERIC.`Material Long Description` AS post_excerpt,
    "" AS post_content,
    "publish" AS post_status,
    "0" AS menu_order,
    "02/22/2013 17:17" AS post_date,
    "0" AS post_parent,
    "closed" AS comment_status,
    PRICE_GENERIC.`EANUPC Code` AS sku,
    "visible" AS visibility,
    PRICE_GENERIC.`Available Quantity` AS stock,
    "instock" AS stock_status,
    "no" AS backorders,
    "" AS manage_stock,
    PRICE_GENERIC.`Customer Price` AS regular_price,
    "" AS sale_price,
    PRICE.Weight AS weight,
    PRICE.Length AS length,
    PRICE.Width AS width,
    PRICE.Height AS height,
    "taxable" AS tax_status,
    "*" AS tax_class,
    "" AS upsell_ids,
    "" AS crosssell_ids,
    "" AS featured,
    "" AS sale_price_dates_from,
    "" AS sale_price_dates_to,
    'http://' AS file_path,
    "" AS download_limit,
    "" AS external_url,
    "" AS images,
    categories_adj.HOOFDCATEGORIE AS `tax:product_cat`,
    "" AS `tax:product_tag`,
    "simple" AS `tax:product_type`
FROM
    PRICE_GENERIC,
    categories_adj,
    PRICE
INNER JOIN `FEES_GENERIC` ON `PRICE_GENERIC`.`Part Number` = `FEES_GENERIC`.`Part Number`
INNER JOIN `HOURLY_STOCK_GENERIC` ON `PRICE_GENERIC`.`Part Number` = `HOURLY_STOCK_GENERIC`.`Part Number`
INNER JOIN `PRICE` ON `PRICE_GENERIC`.`Part Number` = `PRICE`.`Part Number`
INNER JOIN `CATEGORIES` ON `PRICE`.`Sub-Category` = `CATEGORIES`.`Product Hierarchy Number Level 2`
INNER JOIN `categories_adj` ON `CATEGORIES`.`Product Hierarchy Number Level 2` = `categories_adj`.`Product Hierarchy Number Level 2`
WHERE
    `categories_adj`.`HOOFDCATEGORIE` IS NOT NULL
;
4

1 に答える 1

0

PRICEここで、テーブルに2回参加しています。

FROM
    PRICE_GENERIC,
    categories_adj,
    PRICE

そしてここ:

INNER JOIN `PRICE` ON `PRICE_GENERIC`.`Part Number` = `PRICE`.`Part Number`

それが本当にあなたの意図であり、エラーではない場合(私にはそれのように見えます)、最後にそれらの1つのエイリアスを提供する必要があります。

categories_adjテーブルにも同じことが言えます

于 2013-03-11T15:00:01.380 に答える