select CustNo,min(时间) from table
group by CustNo
group by CustNo
解决方案 »
- 本地dbf文件怎么导入到SQLServer2000数据库中
- SELECT [id],count(id) FROM [tt] GROUP BY [id],怎样把 count(id) 的结果保存到一个变量 @cc 中?
- 求一SQL语句
- 三表主外键删除问题
- 优化查询
- SQL中,如何把一个smalldate类型字段更新为空值?
- 关于修改表的字段属性问题
- CSDN 没人了?这个问题都没人能解决?(存储过程问题)
- 一个数据表中两个日期字段,我找出在这两个日期字段中属于某一段日期的记录列出来,该如何操作。
- 求一个SQL语句,谢谢
- 怎样给数据库文件一个数据库名称?
- 这个出错提示是什么原因,我在本机调试没有问题,但传到正式网上后就出问题了?
group by CustNo
where 时间 = (select min(时间) from yourtable where CustNo = A.CustNo)
select CustNo,Min(时间) as sj from 表 group by CustNo order by CustNo
select CustNo,min(时间) as 时间 from table
group by CustNo
where 时间 = (select min( 时间 ) from table where CustNo =a.CustNo )
where 时间 = (select min( 时间 ) from table where CustNo =a.CustNo )
where 时间 = (select min( 时间 ) from table where CustNo =a.CustNo )
not exists(select 1 from 表 bb where aa.时间>bb.时间)
or not exists(select 1 from 表 bb where aa.时间<bb.时间)
group by CustNo
Group By CustNo
select * from yourtable A
where 时间 = (select min(时间) from yourtable where CustNo = A.CustNo)被采用...因为group有太多限制了...呵..