Reply to Re: output parameters from row with max id

Your name:

Reply:


Posted by shiju on 08/01/07 03:29

On Aug 1, 2:45 am, mcolson <mcolson1...@gmail.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)

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация