Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
create procedure ...
@location int,
@building varchar(10)
as
...Your code here...
declare @row_count int
set @row_count = (select max(row_count)+1 from table where location = @location)
insert into table
(location, building, row_count)
values
(@location, @building, @row_count)
go
[Blue]SELECT[/Blue] T1.Location[Gray],[/Gray] T1.Building[Gray],[/Gray] RowCnt [Blue]FROM[/Blue] Table1 T1
[Blue]INNER[/Blue] [Gray]JOIN[/Gray]
[Gray]([/Gray][Blue]SELECT[/Blue] T3.Location[Gray],[/Gray] T3.Building[Gray],[/Gray] [Fuchsia]COUNT[/Fuchsia][Gray]([/Gray]T3.Building[Gray])[/Gray] RowCnt
[Blue]FROM[/Blue] Table1 T2 [Blue]INNER[/Blue] [Gray]JOIN[/Gray] Table1 T3
[Blue]ON[/Blue] T2.Location[Gray]=[/Gray]T3.Location [Gray]AND[/Gray]
T2.Building[Gray]<[/Gray][Gray]=[/Gray]T3.Building
[Blue]GROUP[/Blue] [Blue]BY[/Blue] T3.Location[Gray],[/Gray] T3.Building[Gray])[/Gray] T4
[Blue]ON[/Blue] T1.Location[Gray]=[/Gray]T4.Location [Gray]AND[/Gray] T1.Building[Gray]=[/Gray]T4.Building
[Blue]ORDER[/Blue] [Blue]BY[/Blue] T1.Location[Gray],[/Gray] T1.Building