sql 行轉列超快方法

SELECT model_name,
MAX(case when attr_key='name' then attr_value END) as name,
max(case when attr_key='Description' then attr_value END) as Description,
max(case when attr_key='Temperature' then attr_value END) asTemperature,
max(case when attr_key='Pressure' then attr_value END) as Pressure,
max(case when attr_key='Pressure' then attr_value END) as Pressure,
max(case when attr_key='Shop' then attr_value END) as Shop
FROM P_MODEL_DESIGN_ATTR
group by model_name
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章