Default order of temp table

0

Please login or register to vote for this query.

(click on this box to dismiss)

Open Data

Q&A for developers and researchers interested in open data

create table #tbl (mon char(8) null,id int null, cnt int null);
insert into #tbl (mon,cnt) values
('jul 2014',3100),('jan 2014',3200),
('may 2015',2300),('feb 2015',2600),
('aug 2014',1800),('mar 2015',3700),
('jun 2014',2400);
select * into #temp2 from #tbl
--select * from #temp2
--select * from #tb1

update #tbl set id = datepart(month,cast(mon as datetime)) where id is null;
select * from #tbl order by id;
insert into #tbl (mon,cnt) values
('apr 2015',4500);
update #tbl set id = datepart(month,cast(mon as datetime)) where id is null;
select * from #tbl

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results