【发布时间】:2016-11-21 19:34:11
【问题描述】:
我需要使用两个不同的 WHERE 子句语句查询同一列。
我正在使用 Magento,但无法更改表格格式。
表格视图:catalog_product_entity_varchar
entity_id | attribute_id | value |
5 | 60 | Bear Apprentice |
5 | 86 | bear-apprentice |
5 | 71 | Item Description |
5 | 74 | /a/p/apprentice2.jpg |
我想让它显示为:
entity_id | Item Name | img |
5 | Bear Apprentice | /a/p/apprentice2.jpg |
最终使attribute_id 60 和74 出现在同一行但在两个单独的列中。
是否可以对列别名执行 WHERE 子句?
谢谢!
【问题讨论】:
-
你知道
attribute_id吗? -
@Shaharyar 是的,我想在同一行的两个不同列中获取属性 ID 60 和 74。