我试用as,但查询结果依然是column1,只是在后面多了一行自定义字段,结果为空。
不知如何解决。
似乎很简单的问题,求助请教!
------解决方案--------------------
select column1 as [你想显示的列名]
或
select column [你想显示的列名]
------解决方案--------------------
- SQL code
select column1 as [你想显示的列名] from tablename或 select column [你想显示的列名] from tablename
------解决方案--------------------
- SQL code
这个是查找部门和每种部门的个数select 部门,count(部门)from table group by 部门 这样好像是你要的结果select 部门,count(人员姓名) '人数' from table group by 部门
------解决方案--------------------
select 部门,count(部门) as '人数' from table group by 部门
or
select 部门,count(部门) '人数' from table group by 部门
or
select 部门,'人数'=count(部门) from table group by 部门