图形图标的sql语句行转列
原理就是
select
*
//此处的*换成下面这种格式就可以行转列,下面是正常的sql语句查询
max(case when type="adminCount" then totalCount else 0 end) adminCount
//翻译就是当里面有个数就是自身没有就是0,取最大值
from
(select a.adminCount type,a.totalCount from
(select 'adminCount',count(*) totalCount from admininfo
union all
select 'teacherCount',count(*) totalCount from teacherinfo
常用于图形图表行转列
最后
以上就是俊逸灯泡最近收集整理的关于图形图标的sql语句行转列的全部内容,更多相关图形图标内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复