摘要: 1. 查询岗位名以及岗位包含的所有员工名字 mysql> select post,group_concat(name) from employee group by post; +-----------+-------------------------------------------------+ | post | group_concat(name) ... 阅读全文
posted @ 2018-10-30 19:02 minger_lcm 阅读(155) 评论(0) 推荐(0)
摘要: 创建db5数据库 use db5; 插入用户记录 插入记录 阅读全文
posted @ 2018-10-30 00:48 minger_lcm 阅读(2428) 评论(0) 推荐(0)
摘要: 创建db5数据库 use db5; 插入用户信息 插入记录 阅读全文
posted @ 2018-10-30 00:48 minger_lcm 阅读(230) 评论(0) 推荐(0)
摘要: 有个需求用concat以这种格式打印查询 mysql中 有个concat_ws 可以简单实现 阅读全文
posted @ 2018-10-30 00:44 minger_lcm 阅读(248) 评论(0) 推荐(0)
摘要: 查出所有员工的名字,薪资,格式为 , mysql> select concat('') as name_info , concat('') as salary_info from employee; +---------------------+---------------------+ | name_info | salary_info |... 阅读全文
posted @ 2018-10-30 00:44 minger_lcm 阅读(269) 评论(0) 推荐(0)
摘要: 加上性别 别名 阅读全文
posted @ 2018-10-30 00:43 minger_lcm 阅读(690) 评论(0) 推荐(0)
摘要: 查出来的结果 这是一张虚拟表 因为查出来结果 标注红色的 salary*12 不太直观 利用另外一种方式查表 as 给字段起别名 select 字段 as 别名 from 表名 不加as也可以 默认后面就是别名 阅读全文
posted @ 2018-10-30 00:42 minger_lcm 阅读(1513) 评论(0) 推荐(0)
摘要: 创建数据库company use company; 阅读全文
posted @ 2018-10-30 00:41 minger_lcm 阅读(733) 评论(0) 推荐(0)