Join two tables in MYSQL and avoid duplicate values I created two tables using MYSQL, tblorder and tblitem.
CREATE TABLE `tblorder` (
`orderId` int NOT NULL,
`orderName` varchar(45) NOT NULL,
PRIMARY KEY (`orderId`)


CREATE TABLE `tblitem` (
`itemId` int NOT NULL,
`itemName` varchar(45) NOT NULL,
`itemUnit` varchar(5) NOT NULL,
`itemRate` double NOT NULL,
`orderRef` int NOT NULL,
PRIMARY KEY (`itemId`),
KEY `fk1_idx` (`orderRef`),
CONSTRAINT `fk1` FOREIGN KEY (`orderRef`) REFERENCES `tblorder` (`orderId`)


I tried to join the two tables using query below
SELECT orderId,orderName, itemName, itemUnit,itemRate
FROM tblitem 
INNER JOIN  tblorder on tblorder.orderId = tblitem.orderRef 

Now result show like Image-01

How to remove duplicate values in orderId ,OrderName columns in result table? Thanks to help me to solve this problem.
After joining tables is it possible to get output like below?

Output from new Query
Do this &quot;deduplication&quot; on the application side. It will be much easier to clean up repetitive values with PHP or JS. It is possible to make what you want by UDVs but SQL wasn't intended for it.