使用let赋值给临时变量 var dailys = from f in _postgreDbContext.draws let temp = f.review_time.Value.Date where f.time_Data != null && f.time_Data == temp group f by new { f.id, f.time_Data } into g select new { Date = g.Key.time_Data, g.Key.id, draws_money…
declare @tab table( ID nt identity(1,1) primary key, --从1开始,每次自增1 ,Name nvarchar(200) ) declare a float select @NodesPercentage=Cast((cast(round((case when a>1 then 1 else a end),2) as numeric(10,2)))*100 as varchar(20))+'%'…
测试创建表变量前后,tempdb的空间大小,目前使用sp_spaceused得到大小,也可以使用视图sys.dm_db_file_space_usage use tempdb go Set nocount on Exec sp_spaceused /*插入数据之前*/ declare @tmp_orders table ( list_no int,id int) insert into @tmp_orders(list_no,id) select ROW_NUMBER() over( order…