mySQL SELECT*和group concat
我有下面的SQL查询,它工作得很好。有没有一种方法可以通过这个查询从产品中选择*?我正在努力学习语法mySQL SELECT*和group concat,mysql,Mysql,我有下面的SQL查询,它工作得很好。有没有一种方法可以通过这个查询从产品中选择*?我正在努力学习语法 SELECT GROUP_CONCAT(tc.`name` ORDER BY tc.entity_id) AS cat_ids FROM products AS tp JOIN categories AS tc ON FIND_IN_SET(tc.entity_id, tp.category_ids) GROUP BY tp.category_ids; 您已为产品表指定了别名“tp”。您可以
SELECT GROUP_CONCAT(tc.`name` ORDER BY tc.entity_id) AS cat_ids
FROM products AS tp
JOIN categories AS tc
ON FIND_IN_SET(tc.entity_id, tp.category_ids)
GROUP BY tp.category_ids;
您已为
产品表指定了别名“tp”。您可以使用tp.columnName
访问products
表中的列,或者使用tp.
SELECT tp.*
FROM products AS tp
JOIN categories AS tc
ON FIND_IN_SET(tc.entity_id, tp.category_ids)
GROUP BY tp.category_ids;
这就是你想做的吗
SELECT tp.*, GROUP_CONCAT(tc.`name` ORDER BY tc.entity_id) AS cat_ids
FROM products AS tp
JOIN categories AS tc
ON FIND_IN_SET(tc.entity_id, tp.category_ids)
GROUP BY tp.category_ids;
小组讨论会在哪里?@Barmar如果利亚姆要的是产品。*
,那么他不是要做小组讨论会
,他特别想从一个表而不是另一个表中获取所有信息。他说他想从产品
表中获取所有信息,除了他已经得到的分类信息。