05 2024 档案

摘要:select order_num from orderitems where prod_id = 'TNT2' 结果: order_num 20005 20006 select cust_id from orders where order_num in (20005,2007) select cu 阅读全文
posted @ 2024-05-29 10:36 肥梁 阅读(12) 评论(0) 推荐(0)
摘要:指定分组后,对每个分组里的数据进行聚集 select vend_id, count(*) as num_prods from products group by vend_id; 过滤分组 select cust_id, count(*) from orders group by cust_id h 阅读全文
posted @ 2024-05-29 10:18 肥梁 阅读(26) 评论(0) 推荐(0)
摘要:select avg(prod_price) AS avg_price from products; select count(*) as num_cut from customers; select max(prod_price) AS max_price from products; selec 阅读全文
posted @ 2024-05-29 09:35 肥梁 阅读(13) 评论(0) 推荐(0)
摘要:select vend_name, Upper(vend_name) as vend_name_upcase from vendors order by vend_name Left() Lenght() Locate() Lower() LTrim() Right() RTrim() Trim() 阅读全文
posted @ 2024-05-28 17:22 肥梁 阅读(11) 评论(0) 推荐(0)
摘要:拼接字段 select Concat(vend_name, '(', vend_contry, ')') as vend_title from vendors order by vend_name; 结果: ACME (USA) 删除右侧多余数据整理数据Ltrim(), Trim() select 阅读全文
posted @ 2024-05-28 16:55 肥梁 阅读(14) 评论(0) 推荐(0)
摘要:以下的匹配都试图匹配单词出现。如果存在一个匹配则被检索出来。 检索列prod_name包含文本1000的所有行 select prod_name from products where prod_name REGEXP '1000' order by prod_name; .在正则中表示一个字符 s 阅读全文
posted @ 2024-05-28 15:12 肥梁 阅读(53) 评论(0) 推荐(0)
摘要:%表示任何字符出现任意次数,匹配0,1,多个字符,但是不能匹配Null 找出所有以为jet开头的产品,select prod_id, prod_name from products where prod_name like 'jet%'; 注意:区分大小写,不匹配‘JetPack1000’ 前后两端 阅读全文
posted @ 2024-05-28 14:26 肥梁 阅读(19) 评论(0) 推荐(0)
摘要:两个重要概念 Redis 提供了两种不同的持久化机制来保证数据的持久存储:RDB(Redis Database)和 AOF(Append Only File)。 RDB 持久化 RDB 持久化是通过创建数据集的快照(snapshot)来工作的。在指定的时间间隔内,Redis 会创建一个数据集的内存镜 阅读全文
posted @ 2024-05-14 20:27 肥梁 阅读(87) 评论(0) 推荐(0)