SQL过滤问题

来源:百度知道 编辑:UC知道 时间:2024/06/19 02:52:01
int char
1 A
2 B
3 B
4 A
5 C
6 C
如何用SQL 过滤成
1 A
2 B
5 C

假设你的这个字段名字叫test。
那sql如下:select distinct test from tableA

select distinct * from table;

select first(id),字段 from 表 group by 字段

select max(int),char from table group by char

你这问题太笼统了 HI我吧

select distinct min(t1.int), t1.char
from 表名 t1, 表名 t2
where t1.char = t2.char
group by t1.char