table1 table2
code color size code color content
mk100 red s MK100 red xx
mk100 red m MK100 blue yy
mk100 blue s
mk100 blue m
求输出
code color size content
mk100 red s xx
mk100 red m
mk100 blue s yy
mk100 blue m 因为我的 content 内容很多字,所以我不希望每个size 都出一样的 content , 所以 row 2和 4 是空的
这里比较难一些 ,哪位高人来帮帮忙 , 感激不尽 !
code color size code color content
mk100 red s MK100 red xx
mk100 red m MK100 blue yy
mk100 blue s
mk100 blue m
求输出
code color size content
mk100 red s xx
mk100 red m
mk100 blue s yy
mk100 blue m 因为我的 content 内容很多字,所以我不希望每个size 都出一样的 content , 所以 row 2和 4 是空的
这里比较难一些 ,哪位高人来帮帮忙 , 感激不尽 !
table1
code color size
mk100 red s
mk100 red m
mk100 blue s
mk100 blue m
table2
code color content
MK100 red xx
MK100 blue yy
result
code color size content
mk100 red s xx
mk100 red m
mk100 blue s yy
mk100 blue m
code color size
mk100 red s
mk100 red m
mk100 blue s
mk100 blue m
table2
code color content
MK100 red xx
MK100 blue yy result
code color size content
mk100 red s xx
mk100 red m
mk100 blue s yy
mk100 blue m
union all
select code,color,size,'' from A where A.size='m';