求助,修改一个sql语句
select   a.*,b.*,c.*,d.*   from   dg1   a,dg2   b,dg3   c,dg4   d   where   a.id=b.id   and   b.id=c.id   and   c.id=d.id   order   by   a.id   desc   
 四个表通过id关联,现在如果表c中有两个或多个纪录的话,也会显示出来,这样就会重复,我想如果表c中有多个纪录,只显示其中的一条 
 谢谢! 
------解决方案--------------------select a.*,b.*,c.*,d.* from dg1 a,dg2 b left join (select top 1 * from dg3 )c on b.id = c.id left join dg4 d on c.id = d.id where a.id=b.id  order by a.id desc   
 這個意思?
------解决方案--------------------select distinct a.*,b.*,c.*,d.*   --加个distinct 
 from dg1 a,dg2 b,dg3 c,dg4 d  
 where a.id=b.id and b.id=c.id and c.id=d.id  
 order by a.id desc
------解决方案--------------------yrwx001() ( ) 信誉:100  2007-08-10 11:03:52  得分: 0         
    select a.*,b.*,c.*,d.* from dg1 a,dg2 b left join (select top 1 * from dg3 )c on b.id = c.id left join dg4 d on c.id = d.id where a.id=b.id  order by a.id desc   
 這個意思?        
 --------- 
 你這樣寫不行的,select top 1 * from dg3 ,這樣始終為一條記錄
------解决方案--------------------很多时候用distinct 需要转换数据类型...  而且LZ的需求也不明确
------解决方案--------------------distinct,应该有用~ 
 除非不是重复的纪录~
------解决方案--------------------JF