Mysql
墓锦天
这个作者很懒,什么都没留下…
展开
-
sql行转列
sql行转列问题 行 列 select name ,sum(case when course='语文' then score end) as 语文, sum(case when course='数学' then score end )as 数学, sum(case when course='英语' then score end )as 英语 from score group by name...原创 2019-10-15 13:13:31 · 153 阅读 · 0 评论 -
数据库视图和索引
视图和索引视图概念表达式索引概念索引的3种创建和删除 视图 概念 关键字view 视图是虚拟的表,只包含动态检索时查询的数据,检索出来的数据按照视图定义的格式显示 多表的查询可以借助视图来简化操作 多种角度看待同一数据 保护机密数据 清晰的表达查询 表达式 create view 视图表名 as (联合查询的表达式/内外连接的多表查询) 如果视图存在,再创建的时候会失败 create or ...原创 2019-05-21 16:35:11 · 168 阅读 · 0 评论