🌈 MsSql
테이블 선언 종류(declare @table, create table #table, with table)
James Wetzel
2019. 7. 25. 11:56
728x90
반응형
변수 테이블 선언
declare @temp table (
no varchar(50)
)
임시 테이블 선언
IF OBJECT_ID('tempdb..#temp_table') is not null
DROP TABLE #temp_table
CREATE TABLE #temp_table (
row_num int identity(1,1)
)
CREATE NONCLUSTERED INDEX #temp_table_shipping_no ON #temp_table (shipping_no)
With 테이블 선언
with temp as (
select no
from table
)
728x90
반응형