Re: inserting the max colum in the stored proc
- From: "George Ter-Saakov" <gt-nsp@xxxxxxxxxxx>
- Date: Tue, 13 May 2008 16:10:21 -0400
Sorry, completely not clear....
Can you rephrase or may be write what you want in pseudo SQL....
PS: I meant to say
INSERT INTO table1(Col1, Col2,Col3)
SELECT MAX(col1), col2, col3 FROM table1 GROUP BY col2, col3
George.
"iHavAQuestion" <iHavAQuestion@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3A36BC22-1916-4BEA-BF6E-249D015E3C70@xxxxxxxxxxxxxxxx
Thats fine...
But, I actually wanted to add the MAX(col) from tabe that exists from the
same data base in place of @var1/Col1 in the below stored procedure
Hope you got my question
Create Stored Procedure Name
(
@Var1
@Var2
@Var3
)
Inseret into table1
(
Col1
col2
col3
)
Values
(
@Var1
@Var2
@Var3
)
"George Ter-Saakov" wrote:
you can use something like in (MS SQL)
INSERT INTO table1(Col1, Col2,Col3)
SELECT MAX(col1), col2, col3 GROUP BY col2, col3
George
"iHavAQuestion" <iHavAQuestion@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
news:4D34C984-5584-40B1-B082-2ECDD0DAA5AE@xxxxxxxxxxxxxxxx
I have stored procedure
Create Stored Procedure Name
(
@Var1
@Var2
@Var3
)
Inseret into table1
(
Col1
col2
col3
)
Values
(
@Var1
@Var2
@Var3
)
But in col1 i need to insert select max(col) from tablename, which is
in
the
same database.
how do I do that??
.
- References:
- inserting the max colum in the stored proc
- From: iHavAQuestion
- Re: inserting the max colum in the stored proc
- From: George Ter-Saakov
- Re: inserting the max colum in the stored proc
- From: iHavAQuestion
- inserting the max colum in the stored proc
- Prev by Date: Inserting a cloum in a stored procedure
- Next by Date: Telerik's Controls
- Previous by thread: Re: inserting the max colum in the stored proc
- Next by thread: RE: inserting the max colum in the stored proc
- Index(es):
Relevant Pages
|