這可能是一個愚蠢的問題,但我怎樣才能重命名mysql的輸出?例如像在列,如果我選擇喜歡重命名mysql輸出
SELECT val As New_Value
值列然後在輸出列的名稱將是NEW_VALUE吧?但是如果我想重命名行呢?喜歡上了NEW_VALUE:
New_Value |
Apple |
這裏是我的代碼:
select t1.location AS Location,
max(case when t2.locationid = '2847' then t2.value end) MR,
max(case when t2.locationid = '2839' then t2.value end) Flow,
max(case when t2.locationid = '2834' then t2.value end) Pressure,
max(case when t2.locationid = '2836' then t2.value end) Level
from table2 t2
inner join table1 t1
on t1.id = '2847'
group by t1.location
的這個輸出是
Location | MR | Flow | Pressure | Level
location/east/flow | 20 | 25 | 34 | 45
這是我想要的輸出,我只是希望它是清潔,我希望能夠添加新文字:
Location | MR | Flow | Pressure | Level
2012 East | 20 | 25 | 34 | 45
出於好奇。你爲什麼要這樣做? – screenmutt