随笔分类 - mysql 数据操作 单表查询
摘要:1. 分页显示,每页5条 mysql> select * from employee limit 0,5; +----+------------+--------+-----+------------+---------+--------------+------------+--------+-----------+ | id | name | sex | age ...
阅读全文
摘要:1. 查询各岗位内包含的员工个数小于2的岗位名、岗位内包含员工名字、个数 mysql> select post,group_concat(name),count(id) from employee group by post; +-----------+-------------------------------------------------+-----------+ | pos...
阅读全文
摘要:1. 查询岗位名以及岗位包含的所有员工名字 mysql> select post,group_concat(name) from employee group by post; +-----------+-------------------------------------------------+ | post | group_concat(name) ...
阅读全文
摘要:有个需求用concat以这种格式打印查询 mysql中 有个concat_ws 可以简单实现
阅读全文
摘要:查出所有员工的名字,薪资,格式为 , mysql> select concat('') as name_info , concat('') as salary_info from employee; +---------------------+---------------------+ | name_info | salary_info |...
阅读全文
摘要:加上性别 别名
阅读全文
摘要:查出来的结果 这是一张虚拟表 因为查出来结果 标注红色的 salary*12 不太直观 利用另外一种方式查表 as 给字段起别名 select 字段 as 别名 from 表名 不加as也可以 默认后面就是别名
阅读全文
摘要:创建数据库company use company;
阅读全文
浙公网安备 33010602011771号