You are here: Re: Query for the first and latest wish « MsSQL Server « IT news, forums, messages
Re: Query for the first and latest wish

Posted by Ed Murphy on 02/23/07 04:00

Eugene wrote:

> I have the following table
>
> Name Date Wish Valid
>
> Name is person's name, date defaults to getdate() and is never
> assigned directly (datetime field), Wish is some message, and Valid is
> bit, 1 indicates if the wish is the latest, and therefore valid. All
> previous wishes are kept in database, and are "invalidated" by setting
> the Valid to 0.

The 'Valid' column is redundant (you can use MAX(Date) instead) and
breakable (what if a row with Valid = 1 is deleted?). I'd ditch it
if I were you.

 

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

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