您好 我实际的业务有3段的 请问支持拼接吗
分成3个语句
declare @sql char(100)
select @sql= 'select top'+ @bot +'* into #TMP2 from #TMP1 as T1 order by T1.create_time desc'
execute (@sql)
select @sql= 'select top'+ @rows1 +'* into #TMP3 from #TMP2 as T1 order by T2.create_time desc'
execute (@sql)
select * into #TMP4 from #TMP3 as T3 order by T3.create_time desc
[Quote=引用 1 楼 wwwwb 的回复:]
declare @sql char(100)
select @sql= 'select top'+ @bot +'* into #TMP2 from #TMP1 as T1 order by T1.create_time desc'
execute (@sql)
[/Quote]
您好 我实际的业务有3段的 请问支持拼接吗 还有为什么sybase不支持直接使用变量啊。。
select top @bot * into #TMP2 from #TMP1 as T1 order by T1.create_time desc
select top @rows1 * into #TMP3 from #TMP2 as T2 order by T2.create_time
select * into #TMP4 from #TMP3 as T3 order by T3.create_time desc