数据库基础命令
来源:互联网 发布:fm自建球员数据锁定 编辑:程序博客网 时间:2024/05/18 01:39
- 访问数据库
/usr/bin/mysql -u root -p password
- 显示所有库名
show databases;
- 切换数据库
use database_name;
- 显示所有表名:
show tables;
- count查询
select count(1) from table_name where pid=111;
- 基础查询语句
select * from table_name where pid=2543425 order by id desc limit 0,10;
0表示偏移量,10表示查询size;
order by需要放在limit前面,否则会报类似mysql错误:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by id desc' at line 1
0 0
- 数据库基础命令
- 数据库基础命令
- 数据库基础命令
- DB2数据库基础命令
- SQLite数据库基础命令
- 数据库的基础命令
- 数据库sql一些常考基础命令
- 数据库基础系列之二:mysqldump命令
- Hadoop下hive数据库基础操作命令代码合集
- 基础命令
- 基础命令
- 基础命令
- 基础命令
- 基础命令
- 基础命令
- l数据库基础前四章总结(增删改查基础命令语句的的使用)
- l数据库基础前四章总结(增删改查基础命令语句的的使用
- 数据库命令
- 微信 支付流程
- Linux第二节
- ip地址转换: char * <---> unsigned int
- web页面展示的部分过程
- 我眼中的光明·第六周
- 数据库基础命令
- SpringMVC-学习笔记(1)——理解MVC及快速入门
- Codeforecs 493C Vasya and Basketball 贪心+二分
- 支持向量机(SVM)(一)----介绍SVM
- 3.分布式缓存
- Linux中chmod用法
- nyoj841最高位数字
- 409. Longest Palindrome
- Linux强制用户下线