1.使用 show databases,命令可以查看可用数据库的列表。
show databases;
2.使用use test;表示打开该数据库。
use test;
3.使用describe user;可以查询test表中字段的属性。
describe user;
4.使用select address from user;可以查询user表中address字段的所有值。
select address from user;
5.使用 select distinct address from user;可以查询user表中address字段的所有值,并过滤相同的内容
select distinct address from user;
6.使用select text from user limit 2,5;可以查询user表中address字段的所有值,并请第二行开始取值,一共只取五行。(注意!!!计数是从0开始计算的,实际是第三行开始一共取五行。
select address from user limit 2,5;
网友评论