Viewing 2 posts - 1 through 2 (of 2 total)
select a.MicroTestID,a.TestDate,a.Item,a.ciptype
,case when a.ciptype like '%O%' THEN '0'
Else
row_number() over(partition by item,ciptype order by ciptype desc) END as sequence
from
(select MicroTestID,TestDate,Item,ciptype from #t) a
........:-P
July 19, 2012 at 5:26 am
#1514756
create table #temp
(compny varchar(10),
location varchar(10),
lotno varchar(10),
amount int)
insert into #temp
select distinct a.* ,amount from storage a left outer join ACCOUNTS b
ON a.compny= b.compny
and a.location=b.location
select compny,location,amount from #temp
group...
July 19, 2012 at 3:05 am
#1514689