博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SQL常用语句
阅读量:5052 次
发布时间:2019-06-12

本文共 1149 字,大约阅读时间需要 3 分钟。

CREATE TABLE `member` ( `uid` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` char(255) NOT NULL, `pass` char(255) NOT NULL, `token` char(255) NOT NULL, `src_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '来源id', PRIMARY KEY (`uid`,`name`))INSERT INTO Persons (LastName) VALUES ('Wilson')UPDATE Person SET FirstName = 'Fred' WHERE LastName = 'Wilson' DELETE FROM Person WHERE LastName = 'Wilson'SELECT DISTINCT Company FROM OrdersSELECT * FROM member LIMIT 5SELECT * FROM member WHERE NAME LIKE '%e_a%'SELECT * FROM member WHERE NAME IN ('zen','test')SELECT * FROM member WHERE uid BETWEEN '4' AND '11'SELECT member.`name`,user_data.`nickname` FROM member,user_data WHERE member.`uid`= user_data.`uid`SELECT NAME FROM member UNION SELECT nickname FROM user_data SELECT * FROM tablea INNER JOIN tableb ON tablea.name = tableb.nameSELECT AVG(uid) AS uidAvg FROM memberSELECT COUNT(uid) AS uidAvg FROM member 计数SELECT SUM(uid) AS uidAvg FROM member 总数在 SQL 中增加 HAVING 子句原因是,WHERE 关键字无法与合计函数一起使用。SELECT rid,SUM(zdl) FROM sys_hero WHERE rid < 20000000 GROUP BY rid HAVING SUM(zdl) >7800 LIMIT 0,10

 

转载于:https://www.cnblogs.com/byleaf/p/4346265.html

你可能感兴趣的文章
unix basic command
查看>>
Spring MVC 自定义类型转换器
查看>>
ECS服务器搭建Discuz 邮箱设置,报错处理
查看>>
RHEL 6.5---SVN服务实现过程
查看>>
Install KR3 for AX SP3
查看>>
一个前端开发者换电脑的过程(git篇)
查看>>
mac使用基础
查看>>
CSS选择器小结
查看>>
[差分][倍增lca][tarjan] Jzoj P3325 压力
查看>>
[数学][dp] Jzoj P4236 登山
查看>>
C++继承方式
查看>>
Page2
查看>>
FIT2096 Assignment 2 2019
查看>>
软件工程实验一 复利计算——单元测试
查看>>
Python多进程并发(multiprocessing)
查看>>
读取配置文件参数和文件路径
查看>>
2017 UESTC Training for Graph Theory
查看>>
oracle实用的sqlplus命令
查看>>
Selenium上机实验
查看>>
BZOJ1369/BZOJ2865 【后缀数组+线段树】
查看>>