create table ai (id int, Aid int, times smalldatetime)
insert into ai select 1, 2, '2003-09-29'
insert into ai select 2, 4, '2003-09-28'
insert into ai select 3, 3, '2003-09-29'
insert into ai select 4, 2, '2003-09-26'--把aid一样times最小的排出来
select *
from ai as a
where times in(
select top 1 times from ai where aid=a.aid order by times)
order by id----把aid一样times最大的排出来
select *
from ai as a
where times in(
select top 1 times from ai where aid=a.aid order by times desc)
order by id
insert into ai select 1, 2, '2003-09-29'
insert into ai select 2, 4, '2003-09-28'
insert into ai select 3, 3, '2003-09-29'
insert into ai select 4, 2, '2003-09-26'--把aid一样times最小的排出来
select *
from ai as a
where times in(
select top 1 times from ai where aid=a.aid order by times)
order by id----把aid一样times最大的排出来
select *
from ai as a
where times in(
select top 1 times from ai where aid=a.aid order by times desc)
order by id
/*
多来论坛有什么问题就问,不管是技术性的还是非技术性的,都有人帮忙你的技术上可以问我偶像大力哥,要是他也解决不了,那么老比尔就应该把数据库升级啦非技术问题,可以去非技术版说,无论是爱情,工作,生活问题都有好心人帮忙解决的我来论坛后,就不看书啦学习数据库要记得多看,看练习记得多写SQL语句有困难记得来找高人
1.
<<Microsoft SQL Server 2000技术内幕>>《SQL Server 2000金典教程》
深度 也可以;
人民邮电出版社;
彭林 ,余艳 编著《sql server2000 入门与提高》
周绪 管丽娜 白海波三个人写的,入门还不错清华《sql server 2000基础教程》
觉得挺好懂的。2.
看联机帮助3.
来论坛CSDN就是很好的书了,然后你自己找些题来做做,碰到问题先试试自己解决,不行再到CSDN问问兄弟们。很多高手说过“学习要有压力才能学到东西的”,我借用了,哈哈....if 你的方向是数据库管理员
请全面学习数据库
IF 你是其他程序员
多写SQL语句*/
/*
多来论坛有什么问题就问,不管是技术性的还是非技术性的,都有人帮忙你的技术上可以问我偶像大力哥,要是他也解决不了,那么老比尔就应该把数据库升级啦非技术问题,可以去非技术版说,无论是爱情,工作,生活问题都有好心人帮忙解决的我来论坛后,就不看书啦学习数据库要记得多看,看练习记得多写SQL语句有困难记得来找高人
1.
<<Microsoft SQL Server 2000技术内幕>>《SQL Server 2000金典教程》
深度 也可以;
人民邮电出版社;
彭林 ,余艳 编著《sql server2000 入门与提高》
周绪 管丽娜 白海波三个人写的,入门还不错清华《sql server 2000基础教程》
觉得挺好懂的。2.
看联机帮助3.
来论坛CSDN就是很好的书了,然后你自己找些题来做做,碰到问题先试试自己解决,不行再到CSDN问问兄弟们。很多高手说过“学习要有压力才能学到东西的”,我借用了,哈哈....if 你的方向是数据库管理员
请全面学习数据库
IF 你是其他程序员
多写SQL语句*/
不过我刚才用了,我机器用不了,不知为何
http://soft.269.net/SoftWareList.asp?ClasstreePos=24
到google里查