标签:get 内容 modify customer 过滤 环境 ddl 去重 效率
--如插入数据 id(自增),年龄,性别 INSERT INTO t_name values(‘‘, 20, ‘man‘)
INSERT INTO emp(name,age) VALUES(‘孙悟空‘,100),(‘猪八戒‘,100),(‘唐三藏‘,100)
update emp a,dept b set a.sal=a.sal*b.deptno, b.deptname=a.ename wherea.deptno=b.deptno;
注意别名的用法:设置别名就是为了便捷,所以选择表时如果设置了别名之后使用时就用别名,如果不用别名有时会出现SQL语句错误。
DELETE t1,tt,t3 FROM,t2 tt ,t3 [WHERE 条件];
SELECT * FROM customers AS c LEFT JOIN orders AS o ON c.customer_id = o.customer_id RIGHT JOIN emp ON emp.age=20;
SELECT NAME,age 年龄 FROM emp e WHERE e.age=20;
SELECT empid,custid, YEAR(orderdate) YEAR, SUM(qty) SUM FROM t GROUP BY empid,custid,YEAR(orderdate) WITH ROLLUP;
SELECT*FROM tablename [WHERE CONDITION] [ORDER BYfield1 [DESC|ASC],field2 [DESC|ASC],…,fieldn [DESC|ASC]]
ORDER BY子句中指定SELECT列表中列的序列号,如下面的语句:
SELECT order_id,customer_id FROM orders ORDER BY 2,1; -- 等同于: SELECT order_id,customer_id FROM orders ORDER BY customer_id,order_id;
标签:get 内容 modify customer 过滤 环境 ddl 去重 效率
原文地址:https://www.cnblogs.com/mibloom/p/9724822.html