下午在写一个漫画在线看的程序.要从两个表中取出前10个最新更新记录,但是第一个表中重复的记录太多,用distinct程序报错.
开始是这样写的:select top 10 distinct field1,field2 from table1,table2 where field1.class=field2.classid order by field2.date
原来应该这样写:select distinect top 10 field1,field2 from table1,table2 where field1.class=field2.classid order by field2.date
看来还是基础没打好呀.