sql语句如下
首先是自连接,然后让自连接的值合并为一列
select t1.category,t2.category,t1.category+t2.category as t3.category
from
dbo.Product_category_table t1
join
dbo.Product_category_table
t2
on
t1.id=t2.superid
------解决方案--------------------
- SQL code
--> 或者select t1.category,t2.category,t1.category+t2.category as [t3.category]fromdbo.Product_category_table t1joindbo.Product_category_tablet2ont1.id=t2.superid
------解决方案--------------------
select t1.category,t2.category,t1.category+t2.category as [t3.category ]
from
dbo.Product_category_table t1
join
dbo.Product_category_table
t2
on
t1.id=t2.superid