摘要: 以下以SQL Server 2000中的NorthWind数据库中的Customers表为例,用 临时表 + While循环 的方法, 对Customers表中的CompanyName列进行遍历create table #temp( id int identity(1,1), customer nvarchar(50))declare @customer nvarchar(50)declare @n intdeclare @rows intselect @n=1insert #temp(customer) select distinct companyname from customersse 阅读全文
posted @ 2011-05-26 10:42 yinbo.crazy 阅读(14240) 评论(1) 推荐(0) 编辑