blogspot.com-GA4

星期五, 5月 30, 2008

temptable 使用說明

在進行分頁時可以利用temptable 達成分頁的方式,
temptable 會在連線close之後清除

select rowid=identity(12), column_name into #temptable1 from tablename

select column_name from #temptable1 where rowid >xxxx and rowid < yyyy

PS.
1. # 一定要加,才會是暫存temptable
2. temptable的名稱為 temptable + id 的方式產生

沒有留言: