You are here: A simple query that returns the most current address « MsSQL Server « IT news, forums, messages
A simple query that returns the most current address

Posted by Rex on 07/24/07 02:26

Hi,

I have an Address table which contains more than one addresses for a
particular member. I want to write a query that would only display
most current address. All addresses have a unique ID (addID).
Example:

memberID addID address1
-------- ------ --------------------------------------------------
295 69 13 Auster St
295 70 465 Lorre Ct
295 71 P.O. Box 321
722 171 10 Hannaford Rd
722 172 Dubai, United Arab Emirates

>From the table data above. The query should only return

memberID addID address1
-------- ------ --------------------------------------------------
295 71 P.O. Box 321
722 172 Dubai, United Arab Emirates

I tried using Max and Group by function but it shows me all the rows.
If you can provide me with a sample code that would greatly
appreciated.

cheers

 

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

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