2021
08-06
08-06
MySQL不使用order by实现排名的三种思路总结
假定业务:查看在职员工的薪资的第二名的员工信息创建数据库dropdatabaseifexistsemps;createdatabaseemps;useemps;createtableemployees(empIdintprimarykey,--员工编号genderchar(1)NOTNULL,--员工性别hire_datedateNOTNULL--员工入职时间);createtablesalaries(empIdintprimarykey,salarydouble--员工薪资);INSERTINTOemployeesVALUES(10001,'M','1986-06-26'...
继续阅读 >