日期:2014-05-18 浏览次数:20646 次
use Tempdb go --> --> if not object_id(N'Tempdb..#T1') is null drop table #T1 Go Create table #T1([ID] int,[Name] nvarchar(2),[ShuLiang] int) Insert #T1 select 1,N'上衣',3 Go Select a.[ID],a.Name from #T1 AS a INNER JOIN master.dbo.spt_values AS b ON b.type='P' AND b.number<a.[ShuLiang] /* ID Name 1 上衣 1 上衣 1 上衣 */