table A
--------------
aid | computer
--------------
1 | hp
--------------
2 | sony
--------------table B
--------------
aid | color
--------------
1 | red
--------------
1 | black
--------------
2 | white
--------------如何得出下面的结果?多谢
------------------------------------------
aid | computer | color
------------------------------------------
1 | hp | red;black
------------------------------------------
2 | sony | white
------------------------------------------
--------------
aid | computer
--------------
1 | hp
--------------
2 | sony
--------------table B
--------------
aid | color
--------------
1 | red
--------------
1 | black
--------------
2 | white
--------------如何得出下面的结果?多谢
------------------------------------------
aid | computer | color
------------------------------------------
1 | hp | red;black
------------------------------------------
2 | sony | white
------------------------------------------
解决方案 »
- 触发器问题
- 发现他不走索引
- mysql order by/group by 优化
- 如果sql执行出错...事务会自动回滚吗?
- 数据库导入与导出的问题
- mysqlcc中:[local] ERROR 1146: Table 'test.1' doesn't exist?
- 急问:为什么我用MySql browser的EditeTable遇到的问题?
- 保存路径问题
- 求 utf8编码的表 插入 数据到 gbk 编码的 表 办法
- mysql 存储图片的问题
- GUI工具连接mysql出现2003——can't connect to mysql server on localhost(10061)
- mysql存储过程中的游标取部出值
(
select aid,group_concat(color separator ';') as color from B group by aid
)b
on a.aid=b.aid
from A,B
where a.aid=b.aid
group by a.aid
from TA A INNER JOIN TB B ON a.aid=b.aid
group by a.aid,a.computer