MySQL使用笔记(五)简单数据记录查询

By francis_hao    Dec 14,2016

查询指定字段

mysql> select field1,field2…… from table_name;

查询所有字段

mysql> select * from table_name;

避免重复数据查询

mysql> select distinct field1,field2…… from table_name;

实现四则运算查询

MySQL支持的关系运算符

运算符

描述

+

加法

-

减法

*

乘法

/(DIV)

除法

%(MOD)

求余

mysql> select field1运算,field2…… from table_name;

 

 


本文由 刘英皓 创作,采用 知识共享 署名-非商业性使用-相同方式共享 3.0 中国大陆 许可协议进行许可。欢迎转载,请注明出处:
转载自:http://www.cnblogs.com/yinghao1991/p/6185042.html

 

参考

[1] 王飞飞 崔洋 贺亚茹《MySQL数据库应用从入门到精通(第二版)》北京:中国铁道出版社,2014年9月

 

 

posted on 2016-12-15 22:11  刘英皓  阅读(293)  评论(0编辑  收藏  举报