evantianx / Bloooooooog

Place to record what I thought and learned
0 stars 0 forks source link

SQL 查询 #100

Open evantianx opened 5 years ago

evantianx commented 5 years ago

检索列

evantianx commented 5 years ago

排序列

evantianx commented 5 years ago

过滤数据

evantianx commented 5 years ago

通配符过滤

百分号 %

在搜索串中, % 表示任何字符出现的任意次数

% 不能匹配 NULL

下划线 _

只匹配单个字符而非多个字符

SELECT prod_id, prod_name FROM products WHRER prod_name LIKE '_ ton anvil'

通配符使用注意: a.勿滥用;b. 尽量不在搜索模式开头使用,否则会大大降低搜索速度;c. 注意匹配内容是否符合要求