have you tried to use a subquery likeselect p.productid as '产品ID', 
       p.productname as '品名', 
      (select top 1 productpictureid from productpicture where productid = p.productid) as '图片' 
from product p

解决方案 »

  1.   

    我也觉得出路应该在select(select) 上,只是我不知道如何写。
    我试试看尼的方法。。
      

  2.   

    如果是查询ID,则你的方法可行。但是表二中ProductPicture的数据类型是OLE对象,会出现以下错误提示:子查询productpicture中Memo 或 OLE对象无效by the way,我用的是access还有什么好方法吗救命。。
      

  3.   

    select out the productpictureid, then do a left outer join with ProductPicture....., although it sounds badnot sure if the following works:select p.productid as '产品ID', 
           p.productname as '品名', 
           min(pp.ProductPictureImage) as 'image'     
    from product p 
    left outer join productpicture pp on p.productid = pp.productid
    group by p.productid,p.productname
      

  4.   

    错误信息:合计参数min()不能有memo, OLE或超链接对象
      

  5.   

    select ProductID,ProductName,
      (select top 1 ProductPictureId,ProductPicture
        from ProductPicture where ProductID=a.ProductID)
    from Product a
      

  6.   

    I am not familiar with Access, not sure if the following worksSELECT t.productid, t.productname, t.productpictureid, t2.productpictureImage 
    FROM
     (select p.productid, 
           p.productname , 
          (select top 1 productpictureid from productpicture where productid = p.productid) as 'productpictureid', 
              from product p
      ) tLEFT OUTER JOIN productpicture t2 
    ON t1.productpictureid = t2.productpictureid
      

  7.   

    it works!!!SELECT t.productid, t.productname, t.productpictureid, t2.picturestore
    FROM [select p.productid, 
           p.productname , 
          (select top 1 productpictureid from productpicture where productid = p.productid) as productpictureid from product p]. AS t LEFT JOIN productpicture AS t2 ON t.productpictureid = t2.productpictureid;saucer:
    他们说老大是说你吗?看来真是老大崇敬之情如滔滔江水源源不绝
    我还有另一个贴子在oracle版(下面的链接),请去那里接受我的致敬
    http://expert.csdn.net/Expert/topic/2864/2864020.xml?temp=.6552698