![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am trying to select multiple values from the row with the max id, and output them within my stored procedure. |
#3
| |||
| |||
|
|
I am trying to select multiple values from the row with the max id, and output them within my stored procedure. How would I combine the following two rows so that I only need to use "from mytable where IDnum = (select (max(IDnum)) from mytable))" once. I have at least 8 other outputs I will be setting and would like this to work more efficiently than setting each individually... if possible. set @outmtd = (select outmtd from mytable where IDnum = (select (max(IDnum)) from mytable)) set @outytd = (select outytd from mytable where IDnum = (select (max(IDnum)) from mytable)) Thanks for any help you can give Matt I think this is what looking |
#4
| |||
| |||
|
|
On Aug 1, 2:45 am, mcolson <mcolson1... (AT) gmail (DOT) com> wrote:> I am trying to select multiple values from the row with the max id, and output them within my stored procedure. How would I combine the following two rows so that I only need to use "from mytable where IDnum = (select (max(IDnum)) from mytable))" once. I have at least 8 other outputs I will be setting and would like this to work more efficiently than setting each individually... if possible. set @outmtd = (select outmtd from mytable where IDnum = (select (max(IDnum)) from mytable)) set @outytd = (select outytd from mytable where IDnum = (select (max(IDnum)) from mytable)) Thanks for any help you can give Matt I think this is what looking select @outytd=outytd,@outmtd=outmtd from mytable where IDnum = (select (max(IDnum)) from mytable) |
![]() |
| Thread Tools | |
| Display Modes | |
| |