摘要:
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 阅读全文
摘要:
指定分组后,对每个分组里的数据进行聚集 select vend_id, count(*) as num_prods from products group by vend_id; 过滤分组 select cust_id, count(*) from orders group by cust_id h 阅读全文
摘要:
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 阅读全文
摘要:
select vend_name, Upper(vend_name) as vend_name_upcase from vendors order by vend_name Left() Lenght() Locate() Lower() LTrim() Right() RTrim() Trim() 阅读全文
摘要:
以下的匹配都试图匹配单词出现。如果存在一个匹配则被检索出来。 检索列prod_name包含文本1000的所有行 select prod_name from products where prod_name REGEXP '1000' order by prod_name; .在正则中表示一个字符 s 阅读全文
摘要:
%表示任何字符出现任意次数,匹配0,1,多个字符,但是不能匹配Null 找出所有以为jet开头的产品,select prod_id, prod_name from products where prod_name like 'jet%'; 注意:区分大小写,不匹配‘JetPack1000’ 前后两端 阅读全文