这样的语句能写出来吗
Create table a(sno int,kid int)
Create table b(kid int,kname varchar(40))
insert into a
SELECT 001,001 union all
SELECT 001,002 union all
SELECT 002,001 union all
SELECT 002,003
insert into b
SELECT 001,'数学' union all
SELECT 002,'语文' union all
SELECT 003,'物理'
用上面的结构和测试数据显示出这样的效果:
sno kname
001 数学,语文
002 数学,物理
能用一条语句写出来吗?