sql - UNION SELECT after fetch and offset -


i have following stored procedure:

@offset int, @fetch int  select col1 col tab1 union select col1 tab2 order col offset @offset rows fetch next @fetch rows 

now want add third table union, after offset , fetch has been executed. possible?

union select top 1 col1 tab3 order newid()  

@offset int, @fetch int  cte1 (select top 100 percent col1 col tab1 union select top 100 percent col1 tab2 order col offset @offset rows fetch next @fetch rows only)  select * cte1 union select top 1 col1 tab3 order newid()  

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -