今日学习笔记

select查询语句的扩展

1.select基本语句

table_name是你想查询的目的表名

select * from table_name;

2.select扩展之一

查询多个表的数据

select * from table1,table2,...;

3.select扩展之二

从多个表中查询你想知道的特定列;

slect table1.name1,table2.name2 from table1,table2;

4.select扩展之三

查询符合条件的数据

select * from table1 where 条件;

5.select扩展之四

多个筛选条件用and连接

select * from table1 where 条件1 and 条件2;

6.select扩展之五

多个表之间有联系,用where消除笛卡尔,将联系的数据整合

select * from table1,table2 where table.联系列名 = table2.联系列名;

7.select扩展之六

展示经过多条筛选之后想查询的特定数据,并消除笛卡尔进行整合

select table1.name1,table2.name2 from table1,table2 where table1和table2的连接关系;

8.select扩展之七

排序及sum和group by的使用

select table.name2,sum(table1.name1,table2.name) as a from table1,table2 group by table.name2,a;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值