I have table where all item names and their itemcodes are displayed.
TableItem
ItemID, ItemName
772729918, 'ABC'
772729921, 'BCD'
772729922, 'EFG'
772729923, 'HIJ'
772729926, 'KLM'
I have another table which has the item image paths defined.
TableImages
itemimageID, Imagesurface,ImagePath, fitemID
111,'FRONT', '772729918_1_1_FRONT.tif', 772729918
112,'BACK', '772729918_1_1_BACK.tif',772729918
222,'FRONT','772729921_1_1_FRONT'.tif,772729921
223,'BACK','772729921_1_1_BACK.tif',772729921
333,'FRONT','772729922_1_1_FRONT.tif',772729922
332,'BACK', '772729922_1_1_BACK.tif',772729922
444,'FRONT','772729923_1_1_FRONT.tif',772729923
442,'BACK', '772729923_1_1_BACK.tif',772729923
555,'FRONT','772729926_1_1_FRONT.tif',772729926
552,'BACK', '772729926_1_1_BACK.tif',772729926
If I join these two table i am getting values as below.
Select ItemID,ItemName, Imagesurface,ImagePath from TableItem i inner join TableImages ti on ti.fitemID = i.ItemID
772729918,'ABC','FRONT','772729918_1_1_FRONT.tif'
772729918,'ABC','BACK','772729918_1_1_BACK.tif'
772729921,'BCD','FRONT','772729921_1_1_FRONT.tif'
772729921,'BCD','BACK','772729921_1_1_BACK.tif'
772729922,'EFG','FRONT','772729922_1_1_FRONT.tif'
772729922,'EFG','BACK','772729922_1_1_BACK.tif'
772729923,'HIJ','FRONT','772729923_1_1_FRONT.tif'
772729923,'HIJ','BACK','772729923_1_1_BACK.tif'
772729926,'KLM','FRONT','772729926_1_1_FRONT.tif'
772729926,'KLM','BACK','772729926_1_1_BACK.tif'
Actually I want to show them in one row instead of 2 line for each item. Thanks for helping me.
ItemID, ItemName, ImageSurface, ImageFront, ImageBack
772729918,'ABC','FRONT','772729918_1_1_FRONT.tif','772729918_1_1_BACK.tif'
772729921,'BCD','FRONT','772729921_1_1_FRONT.tif','772729921_1_1_BACK.tif'
772729922,'EFG','FRONT','772729922_1_1_FRONT.tif','772729922_1_1_BACK.tif'
772729923,'HIJ','FRONT','772729923_1_1_FRONT.tif','772729923_1_1_BACK.tif'
772729926,'KLM','FRONT','772729926_1_1_FRONT.tif','772729926_1_1_BACK.tif'