Hi,
I am trying to do the following but I am stucked. I have a table
workdb..a (column num), I want to get the maximum number of column num
to store it as a local variable.
TABLE WORKDB..A
num
1
2
3
4
5
DECLARE @.max
Thanks a lot!!!
MichaelMichael,
DECLARE @.max
set @.max = (select max(num) from dbo.a)
-- or
select @.max = max(num) from dbo.a
AMB
"Michael" wrote:
> Hi,
> I am trying to do the following but I am stucked. I have a table
> workdb..a (column num), I want to get the maximum number of column num
> to store it as a local variable.
> TABLE WORKDB..A
> num
> 1
> 2
> 3
> 4
> 5
>
> DECLARE @.max
> Thanks a lot!!!
> Michael
>|||On Apr 9, 12:10 pm, Alejandro Mesa
<AlejandroM...@.discussions.microsoft.com> wrote:
> Michael,
> DECLARE @.max
> set @.max = (select max(num) from dbo.a)
> -- or
> select @.max = max(num) from dbo.a
> AMB
>
> "Michael" wrote:
>
>
>
>
> - Show quoted text -
Great!! Thank you!!!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment