SQL Question

Data from the Second Table repeats when using Left Outer Join

Good Morning Everyone. I`m creating an MySQL Command to
make this output.

enter image description here

but when I tried it the Output is this.

enter image description here

Here is my code.

select purchorder.PONo,purchorder.ItemCode,purchorder.Description,
purchorder.OrderQty,
receiving.ItemCode,receiving.Description,Receiving.ReceivedQty from purchorder
LEFT OUTER JOIN Receiving on receiving.RIno = purchorder.RINumber where
purchorder.PONo = 'P0239ROI'
Group BY purchorder.ItemCode;


Table PurchOrder

enter image description here

Table Rceiving

enter image description here

How can I achieve the Output above? (With the Yellow Header)

Here is the Latest Possible answer

enter image description here
TYSM

Answer

You can achieve that just remove your group by clause and add receiving.RIno in SELECT clause.

SELECT DISTINCT
    purchorder.PONo,
    purchorder.ItemCode,
    purchorder.Description,
    purchorder.OrderQty,
    receiving.RIno,
    receiving.ItemCode,
    receiving.Description,
    Receiving.ReceivedQty
FROM purchorder
LEFT JOIN Receiving ON receiving.RIno = purchorder.RINumber
AND Receiving.ItemCode = purchorder.ItemCode
WHERE purchorder.PONo = 'P0239ROI'