Mysql基础第七天,检索数据
Posted 2019ab
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Mysql基础第七天,检索数据相关的知识,希望对你有一定的参考价值。
1.创建样例表
打开mysql命令行执行
use test;
courese c:\\\\create.sql; // 将表结构导入
course c:\\\\info.sql; // 将数据导入
2.sqlect语句
查询表中内容.
select prod_name from producs; //查询单个列
select prod_id,prod_name from products; // 查询多个列
select * from products;// 查询所有列
select distinct prod_name from products;//查询不同的行
// 限制结果
select * from products limit 5; // 查询不同的行
select * from products limit 4,5; // 从第四条开始往后显示五条
select products.prod_id,products.prod_name,products,prod_price from products; // 使用完全限定表名
以上是关于Mysql基础第七天,检索数据的主要内容,如果未能解决你的问题,请参考以下文章