-1
我需要時,我用它來保持這個作爲子查詢它在聲明拋出一個錯誤插入這個結果在一個表中結果插入到表
declare @i int
set @i=(select max(id) from finalaccountdetails)
(
select ROW_NUMBER() OVER (ORDER BY DateTime_Executed)[email protected] as id ,
DateTime_Executed, ReportName,Region, 'IM Account' as Account_Name_Level_1,'IM' as Management_Group_Name,
replace(
replace(C
,'%5c','\')
,'%2B','+') as Account_code_level_1 ,count(*) as NumberofExecution from preaccountdetails
group by DateTime_Executed, ReportName,Region,c
having c like '%-%' or c like '%2B%')
。
懇請指正。
這將只能使用一次,但我需要插入到同一個表上多次按我的要求 –