摘要:
主表:ProductsID ProductName1上衣2短裤3 帽子外键表:ProdutImageID ProductID ProductImage11上衣图片一21 上衣图片二3 2 短裤图片一4 2 短裤图片二SELECT *FROM [SELECT Products.*, (select max(ID) from productImage where ProductID = Products.ID) AS MaxImageIDFROM Products]. AS TA, ProductImageWHERE ProductImage.ID=TA.MaxImageID; 阅读全文