select name, time, card from table_name where name='Mr.A' group by name, time, card
如果要带 NO select * from table_name t1 where rowid =( select min(rowid) from ( select name, time, card from table_name where name='Mr.A' group by name, time, card) t2 where t1.name=t2.name and t1.card=t2.card and t1.time=t2.time)
select * from tb where no in(select min(no) from tb where name='Mr.A' group by card)
select distinct(Card) from t_your_table where Name='Mr.A';result123456 222222有点不明白你的意思,如果你要的结果必须包含所有信息,那么No这个字段的信息就有局限性了。
select distinct name, time, card from table_name where name='Mr.A' 来迟了.还好我这个也还算正确!
where name='Mr.A'
group by name, time, card
select * from table_name t1 where rowid =(
select min(rowid) from (
select name, time, card from table_name
where name='Mr.A'
group by name, time, card) t2 where
t1.name=t2.name and t1.card=t2.card and t1.time=t2.time)
222222有点不明白你的意思,如果你要的结果必须包含所有信息,那么No这个字段的信息就有局限性了。
where name='Mr.A'
来迟了.还好我这个也还算正确!
DISTINCT本来就是用来过滤重复的记录的.
而且它还只能出现在SELECT 的后面.
where name='Mr.A'
where name='Mr.A'
写这么复杂干嘛呢
简单问题复杂化
distinct