declare @parentKey char(36)
 
  set @parentKey='B4B519EF-13F9-4F85-A382-21362F337D9D'
  select [Pro_ProductCategory].[CategoryName]+'('+
    cast((select COUNT(1)from Pro_ProductMST where ProductModelKey in (select ModelKey from Pro_ProductModel where CategoryKey=[Pro_ProductCategory].CategoryKey)) as varchar)
+')' as 'CategoryStatic'
    from [Pro_ProductCategory] where [parentKey]=cast(@parentKey as uniqueidentifier)
    

这里的关键是要写上36这个长度,不然使用varchar是会报错的.

相关文章:

  • 2021-08-06
  • 2022-12-23
  • 2022-12-23
  • 2022-01-04
  • 2022-01-22
  • 2021-10-11
猜你喜欢
  • 2022-03-01
  • 2021-12-20
  • 2021-10-14
  • 2021-09-25
  • 2021-12-22
  • 2022-12-23
相关资源
相似解决方案