table表如下
id name
1 a
2 b
3 c
4 c
5 b
Test1
select distinct name from table
----------
name
a
b
c
Test2
select distinct name, id from table
----------
id name
1 a
2 b
3 c
4 c
5 b
注:distinct同时作用了两个字段
Test3
select id, distinct name from table
----------
出错
注:distinct必须放在所有字段之前
Test4
select *, count(distinct name) from table group by name
----------
id name count(distinct name)
1 a 1
2 b 1
3 c 1
注:这样就能去掉重复name的字段,且只会匹配出第一个出现的结果
三个资料Q群下载不了也转发不了,先放这里Fine_tuning.zipLangChain.zipdata_clear.rar
在第一节基础上 更新了函数和执行顺序:实操了字符数函数、时间函数、字段截取函数、interval函数等,除最后顺序实操因未导入数据库,导致无法执行