Hi all,
I have two tables and both tables have a columns with the same name "ImageID".
Table 1: SalesItems has multiple records each with a ImageID
Table 2: Images has multiple record some of which have the same imageID.
What I am trying to do is extract all the data from table1 and all the data from table2 where the ImageID's in table 2 match the ImageId in table 1.
So far I have this:
SELECT
SaleItems.RecordID,
SaleItems.StockNo,
SaleItems.Description,
SaleItems.Comment,
SaleItems.Size,
SaleItems.Category,
SaleItems.SubCategory,
SaleItems.Position,
SaleItems.NewArrival,
SaleItems.Sold,
SaleItems.ArchivedItem,
SaleItems.Cost,
SaleItems.Value,
SaleItems.WebImagePath,
SaleItems.ImageID,
Images.ImageID,
Images.ImageName
FROM Images
JOIN SaleItems USING (ImageID)
WHERE Category = 5
The issue I have it returns rows for all the data in SalesItems multiple times, one row for every ImageID match.
Is there a way to return one row with all the data from table 1 and table 2.
I hope I have explained this clearly.
many thanks for any help you can provide.
Blackbox