ITEM
我的table1 中有一个字段。如果ITEM
包含%USED-%
(USED-) 那么我想将其制作TIER1
Used Restaurant Equipment
成相应的分组。
IF
这是我目前的陈述,我怎样才能用or实现上述目标CASE
?
select
CT.TIER1, CT.TIER2
from
trx.table1 MT
LEFT JOIN
trx.table2 CT1 ON MT.ITEM = CT1.ITEM
LEFT JOIN
trx.table3 CT ON CT1.WEB_NUM = CT.WEBNUMBER
GROUP BY CT.TIER1
LIMIT 0 , 15
电流输出:
TIER1 TIER2
NULL NULL
Business Type Ice Cream Equipment
Chinese Food Equipment Ricers
Concession Equipment Concession Accessories
Cooking Equipment Fryers
Food Preparation Food Preparation Supplies
Food Storage Storage Racks
Food Warming Equipment Hot Food Wells
我希望仍然有一些NULL
Tier1 和 Tier2,但我希望它也将 TIER1 显示为“使用过的餐厅设备”,类似于以下内容:
TIER1 TIER2
NULL NULL
Used Restaurant Equipment NULL
Business Type Ice Cream Equipment
Chinese Food Equipment Ricers
Concession Equipment Concession