Member-only story
GROUP_CONCAT() Example In MySQL With Join
In MySQL, sometimes we need to fetch the particular column value of multiple rows using the same id i.e. the foreign key that belongs to the primary key of the other table. As such, with the help of the GROUP_CONCAT() example in MySQL, we can do this.
GROUP_CONCAT() function in MySQL with Join
Suppose we have a table name ‘items’ in our database,
DDL information of the table
CREATE TABLE items
(id
int(10) unsigned NOT NULL AUTO_INCREMENT,item_name
varchar(225) DEFAULT NULL,
PRIMARY KEY (id
)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4
Suppose, we have another table name ‘item_details’ in our database