《mysql必知必会》学习_第四章_20180724_欢
P27:
select prod_name from products; # select 列 from 表 # 从表products 中检索 名为 prod_name 的列

P28 多个语句一起必须要加上分号(;)
select prod_name from products;select vend_id from products; #这是两条语句,两个都加上分号,就会一起运行#

P22
select prod_id,prod_name,prod_price from products; #展开多个列的时候,用逗号(,)把列分开#

P23
show * from products; #通配符(*)返回所有列#

P24
select vend_id from products; #把表products的列vend_id所有出现的值都列出来(包括重复的)#

select distinct vend_id from products; #加上了distinct ,去重#

P25 限制结果
select prod_name from products limit 5; #在表products 的列prod_name 中选择前5个#

select prod_name from products limit 5,3; ##在表products 的列prod_name 中的第5个值开始选个#

P26 使用完全限定的表名
select products.prod_name from products; #product.prod_name限定列prod_name在表products中#

select products.prod_id from hh.products; #products.prod_id限定列prod_id是表products 的, 表products是数据库hh中的#

《mysql必知必会》学习_第四章_20180724_欢的更多相关文章
- 《mysql必知必会》学习_第三章_20180724_欢
P16: use crashcourse; #选择数据库#使用crashcouse这个数据库,因为我没有crashcourse这个数据库,所以用我的hh数据库代替. P17: show databas ...
- 《mysql必知必会》学习_第18章_20180807_欢
第18章 全文本搜索 P121 #创建一个新表,对表的列进行定义,定义之后,MySQL自动维护该索引# create table productnotes ( note_id int NOT ...
- 《mysql必知必会》学习_第五章_20180730_欢
使用的工具是wamp的Mysql. P29 select prod_name from products; #在表products中选列prod_name,顺寻不是纯粹的随机,但是没有说明排列顺序, ...
- 《mysql必知必会》学习_第22章_20180809_欢
第22章:使用视图,视图是虚拟的表,以表形式呈现的是你查询的结果.并不是说在数据库里面真的存在这个表,但是是真的存在这些数据. select cust_name,cust_contact from c ...
- 《mysql必知必会》学习_第20章_20180809_欢
第20章:更新和删除数据 P140 update customers set_emails='elmer@fudd.com' where cust_id=10005; 更新多个列,用逗号隔开.注意被指 ...
- 《mysql必知必会》学习_第19章_20180809_欢
第19章 插入数据 P132 insert into customers VALUES(NULL,'Pep E.Lapew','100 Main Street',,Los Angeles','CA', ...
- 《mysql必知必会》学习_第17章_20180807_欢
第17章:组合查询 P114 select vend_id ,prod_id,prod_price from products where prod_price <=5 ; select ven ...
- 《mysql必知必会》学习_第16章_20180807_欢
第16章:创建高级联结. P106 select concat(RTrim(vend_name),'(',RTrim(vend_country),')') as vend_title from ven ...
- 《mysql必知必会》学习_第15章_20180806_欢
第15章:联结表 P98 外键:外键为某个表的一列A,同时这一列包含另一个表的主键值B(B属于A,等于或者小于的关系) P99 select vend_name,prod_name,prod_pric ...
随机推荐
- 优化myeclipse启动速度以及解决内存不足问题
解决myeclipse内存不足问题: 使用 MyEclipse 开发项目后,随着项目文件的增多,以及运行时间的增加,实际上 MyEclipse 所消耗的内存是会一直增大的,有的时候会出现 MyEcli ...
- vue 动态路由按需加载的三种方式
在Vue项目中,一般使用vue-cli构建项目后,我们会在Router文件夹下面的index.js里面引入相关的路由组件,如: import Hello from '@/components/Hell ...
- .net序列化
在开发过程中,会遇到很多需要使用序列化的场景,比如wcf,webservice或者jquery+.net等.那今天就说说我对序列化的理解. 在.net中有几种序列化的方式,XML.二进制.SOAP.还 ...
- ubuntu12.04下安装Apache+PHP+MySQL
一.Apache1.安装apache2: sudo apt-get install apache2 2.重启apache2: sudo /etc/init.d/apache2 restart 3.在浏 ...
- Shortest Unsorted Continuous Subarray LT581
Given an integer array, you need to find one continuous subarray that if you only sort this subarray ...
- Sophus libSophus.so
在编译包含Sophus的源文件的时候,出现如下错误 ../lib/libmyslam.so: undefined reference to `Sophus::SO3::SO3(double, doub ...
- Asp.Net 启用全局IE兼容模式
Asp.Net 启用全局IE兼容模式,不失为一个种简单最有效的解决方案: <system.webServer> <!-- 配置全局兼容 --> <httpProtocol ...
- NOIP2017提高组预赛详解
NOIP2017预赛终于结束了. 普遍反映今年的卷子难度较大,但事实上是这样吗?马上我将为您详细地分析这张试卷,这样你就能知道到底难不难. 对了答案,鄙人考得还是太差了,只有91分. 那么下面我们就一 ...
- Python之tornado
一.快速了解Tornado框架 1)tornado简介 Tornado 和现在的主流 Web 服务器框架(包括大多数 Python 的框架)有着明显的区别:它是非阻塞式服务器,而且速度相当快.得利于其 ...
- RNN模型(递归神经网络)简介
有些任务可以通过MLP多层感知器的神经网络,CNN卷积神经网络解决,因为那些任务内部的每一个前后无关联,无顺序,如MNIST手写数字子集,CIFAR子集等. 但是在自然语言处理中,每个字的前后有语义联 ...