You are here: Re: Insert « MsSQL Server « IT news, forums, messages
Re: Insert

Posted by MC on 09/29/86 11:31

You need to add time column to the table. Then you can select the
max(column) and use it to find the 'latest' column.

something like

select col1, col2, col3
from table
where AddTime = (select max(AddTime ) from table)


Offcourse, you need to think about this.Can there bi more then one 'latest'?
If someone updates the column, does it make 'latest' (if yes try using
timestamp). And so on.


MC




"Eugene Anthony" <solomon_13000@yahoo.com> wrote in message
news:DpIbf.3$r_5.1202@news.uswest.net...
> Lets say I have 1000 records stored in my database. Now I insert a new
> record into my database, how do I retrieve the lastest record from my
> database using a simple SQL statement.
>
> Eugene Anthony
>
> *** Sent via Developersdex http://www.developersdex.com ***

 

Navigation:

[Reply to this 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

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