这个标题可能很奇怪,但我正在寻找一个可以做到这一点的查询:我的table上有一行是这样的:传感器|地址|类型|测量| 1 |类型|测量| 2我想做一个sql查询,它可以给我这样的信息:结果1:传感器|地址=x |类型|测量=类型|测量| 1结果2:sensor_address=x(相同)| type_measure=type_measure_这在sql中可能吗?
6za6bjd01#
像这样:
SELECT Sensor_address, type_measure_1 as type_measure FROM [table] UNION ALL SELECT Sensor_address, type_measure_2 as type_measure FROM [table]
1条答案
按热度按时间6za6bjd01#
像这样: