怎麼樣把這個語句查詢出來讓主鍵為不重復 
select A.serialno,A.product_no,B.id from ep_meeting_hd A left join CRC_LogDB B on A.product_no =B.product_no 我這樣查詢出來的數據主鍵是重復的
如果是查詢單表的話主鍵的數據是不重復的 
不知道是不是因為A和B中的product_no 中有重復的原因

解决方案 »

  1.   

    select  distinct
      
    *****************************************************************************
    欢迎使用CSDN论坛阅读器 : CSDN Reader(附全部源代码) 
    http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html
      

  2.   

    用distinct 或 select [name],[bh] from [table] 
    where [Name] in(select [Name] from [table] group by [Name] having count([Name])=1) 
      

  3.   

    使用select  distinct ******** 可以把不重复的行不显示出来
      

  4.   

    估計問題不是distinct這麼簡單,請把問題說清楚