即使列存在,也会出现“未知列”错误

时间:2013-08-13 19:30:52

标签: mysql

我收到一个未知的列错误:

  

1054 - 'where子句'中的未知列'products_to_categories.products_id'

   SELECT `products`.`products_date_added`, 
`products`.`products_model`, 
`products_description`.`products_name`, 
`products_description`.`products_description`, `products_description`.`products_description_second`

    FROM products, products_description

    WHERE products.products_id=products_description.products_id 
AND products.products_id = products_to_categories.products_id 
AND products_to_categories.categories_id <> '91'or '46' 
    ORDER BY `products`.`products_date_added` DESC

事情是该列存在。我甚至检查了拼写。我做错了什么?

1 个答案:

答案 0 :(得分:4)

但它有一个未知的表前缀。 “products_to_categories”不是您在FROM-Clause中选择的表格。

将表 products_to_categories 添加到FROM部分。

… FROM products, products_description, products_to_categories ...