MySQL D3

数据筛选

ORDER BY 可升序可降序 默认升序

DESC 降序


运算符号



练习

记得先调用数据库 USE ClassicModels;

USE ClassicModels;

1. 根据amount给Payments表格排序, 降序

SELECT*FROM Payments

ORDER BY amount DESC;

2. 根据officeCode, employeeNumber给Employees排序, officeCode降序, employeeNumber升序

SELECT*FROM Employees

ORDER BY officeCode DESC, employeeNumber;

3. 查看Employees表格中officeCode 6的1619 employeeNumber的所有信息

SELECT*FROM Employees

WHERE officeCode=6 AND employeeNumber=1619;

4. 查看Order表格中orderNumber中10123到10425所有的信息

SELECT*FROM Orders

WHERE orderNumber Between 10123 And 10425;

你可能感兴趣的:(MySQL D3)