【发布时间】:2011-07-18 23:05:50
【问题描述】:
我想格式化 SQL 结果,然后导出为 CSV(phpMyAdmin 导出)。
SQL语句:
SELECT
product.name,
features.text
FROM products as product, product_features as features
WHERE
features.product_id=products.id LIMIT 0,100
表格结构:
表products:
------------
id | name
------------
24 Baseball
25 Rope
表product_features:
--------------------------
id | text | product_id
--------------------------
45 Leather.. 24
46 Hardball 24
47 Nylon 25
48 Black 25
问题:我明白了:
Baseball Leather
Baseball Hardball
Rope Nylon
Rope Black
我很难理解使用 SQL 语句执行哪种类型的解决方案。
我正在寻找的结果:
Baseball, Leather..., Hardball
Basketball, Nylon, Black
【问题讨论】:
标签: mysql sql select csv export