sql server行转列
摘要:
declare@sqlvarchar(8000)set@sql='selectd.sBillNo,g.goodsId';SELECT@sql=@sql+','''+g.GoodName+'''=isnull(sum(caseg.GoodNamewhen'''+g.goodName+'''thend.Qtyend),0)'from(SELECTdistinctg.goodsId,g.GoodNameFROMBS_GoodsInfoginnerjoinBS_dSaleBi 阅读全文
posted @ 2007-10-27 19:27 小土泥 阅读(117) 评论(0) 推荐(0) 编辑