![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
学习
文章平均质量分 85
Jettle-perfect
这个作者很懒,什么都没留下…
展开
-
SQL必知必会要点记录(6/6)
SQL必知必会要点记录(6/6) *游标CURSOR 1-定义游标 DECLARE CURSOR CustCursor IS SELECT * FROM Customers WHERE cust_email IS NULL 2-使用游标 OPEN CustCursor 3-从游标中检索记录 3-1纯检索 DECLARE TYPE CustCursor IS REF CURSOR RETURN Customers%ROWTYPE; DECLARE CustRecord Customers...原创 2021-05-18 15:14:09 · 135 阅读 · 0 评论 -
SQL必知必会要点记录(5/6)
SQL必知必会要点记录(5/6) *创建表CREATE TABLE:后接表名,若不指定NOT NULL,默认为NULL CREATE TABLE PRODUCTS ( prod_id CHAR(10) NOT NULL, vend_id CHAR(10) NOT NULL, prod_name CHAR(254) NOT NULL, prod_price DECIMAL(8,2) NOT NULL, p...原创 2021-05-17 17:27:32 · 152 阅读 · 1 评论 -
SQL必知必会要点记录(4/6)
SQL必知必会要点记录(4/4) *外联结--LEFT OUTER JOIN:选择左侧表中的所有行;RIGHT OUTER JOIN:选择右侧表中的所有行 SELECT Customers.cust_id , Orders.order_num FROM Customers LEFT OUTER JOIN Orders ON Customers.cust_id = Orders.cust_id ; *全外联结 SELECT Customers.cust_id , Orders.order_num FROM原创 2021-05-13 16:26:04 · 146 阅读 · 0 评论 -
SQL必知必会要点记录(3/6)
SQL必知必会要点记录(3/4) *HAVING 前要结合GROUP BY SELECT vend_id , COUNT(*) AS num_prods FROM Products WHERE prod_price >=4 GROUP BY vend_id HAVING COUNT(*) >=2; *GROUP BY 与ORDER BY 再探 SELECT order_num , COUNT(*) AS items FROM OrderItems GROUP BY order_num HAV原创 2021-05-12 18:02:38 · 123 阅读 · 0 评论 -
SQL必知必会要点记录(2/6)
SQL必知必会要点记录(2/4) *字段拼接:+或者|| 或者, SELECT vend_name + '(' + vend_country + ')' FROM Vendors ORDER BY vend_name; 或者 SELECT vend_name || '(' || vend_country || ')' FROM Vendors ORDER BY vend_name; 或者 SELECT vend_name , '(' , vend_country , ')' FROM Vendors OR原创 2021-05-11 17:41:18 · 202 阅读 · 1 评论