I have two tables, products
and product_tags
.
products table;
product_id int
name varchar
description text
price decimal(12,2)
status enum
sale int
hit int
date_add datatime
date_update datetime
product_tags table;
tag_id int
product_id int
tag varchar
where the product_tags
table has a one to many relation with products
, for example:
tag_id | product_id | tag
1 1 tag1
2 1 tag2
3 1 tag3
I want to pull data from a single query. (product and product tags).