从这段代码中,对于 locationid 5、6、7、8,它是否可能位于第二行而不是继续?
SELECT
MAX(case when locationid = '1' then floatvalue end) Flow,
MAX(case when locationid = '2' then floatvalue end) Level,
MAX(case when locationid = '3' then floatvalue end) Pressure,
MAX(case when locationid = '4' then floatvalue end) MR,
MAX(case when locationid = '5' then floatvalue end) Flow,
MAX(case when locationid = '6' then floatvalue end) Level,
MAX(case when locationid = '7' then floatvalue end) Pressure,
MAX(case when locationid = '8' then floatvalue end) MR
FROM table
所以代替这个:
Flow | Level | Pressure | MR | Flow | Level | Pressure | MR |
10 | 20 | 30 | 40 | 100 | 200 | 300 | 400 |
它会是这样的:
Flow | Level | Pressure | MR |
10 | 20 | 30 | 40 |
100 | 200 | 300 | 400 |