--你没有说表的结构,我就乱说吧
select avg(车速), substring(车次, 1, 1) from 列车运行表 where (车次 like 'K%') OR (车次 like 'T%') OR (车次 like 'Z%') group by substring(车次, 1, 1)
select avg(列名) from 表名 where 列名 like 'k%'
select avg(列名) from 表名 where 列名 like 'T%'
select avg(列名) from 表名 where 列名 like 'Z%'
分别写可行呢?
select avg(chesu) as K from table
where checi like 'K%'
select avg(chesu) as T from table
where checi like 'T%'
select avg(chesu) as Z from table
where checi like 'Z%'
把表结构贴出来