C
cytown
Unregistered / Unconfirmed
GUEST, unregistred user!
Create Procedure showmax
/*
(
)
*/
As
set nocount on
declare @maxa1 int
declare @maxa2 int
declare @maxa3 int
declare @maxa4 int
select @maxa1=max(a1) from table1
select @maxa2=max(a2) from table1
select @maxa3=max(a3) from table1
select @maxa4=max(a4) from table1
if @maxa1>@maxa2
select @maxa2=@maxa1
if @maxa3>@maxa4
select @maxa4=@maxa3
if @maxa2>@maxa4
select @maxa4=@maxa2
select @maxa4 as maxall
return
/*
(
)
*/
As
set nocount on
declare @maxa1 int
declare @maxa2 int
declare @maxa3 int
declare @maxa4 int
select @maxa1=max(a1) from table1
select @maxa2=max(a2) from table1
select @maxa3=max(a3) from table1
select @maxa4=max(a4) from table1
if @maxa1>@maxa2
select @maxa2=@maxa1
if @maxa3>@maxa4
select @maxa4=@maxa3
if @maxa2>@maxa4
select @maxa4=@maxa2
select @maxa4 as maxall
return