Distinct qurery - TechRepublic
Question
December 27, 2008 at 08:49 AM
sarasami

Distinct qurery

by sarasami . Updated 17 years, 6 months ago

Hi every one,
How can use DISTINCT even when I use joined table and the selected field contain text and image fields

in other word how can I get distinct value from this query:
SELECT SiteHotel.HotelID, SiteHotel.Logo, SiteHotel.HotelName, SiteHotel.Stars, SiteHotel.Theme, SiteHotel.City, SiteHotel.Location FROM SiteHotel INNER JOIN Room ON SiteHotel.HotelID = Room.HotelID INNER JOIN Reserve ON Room.[Room No] = Reserve.[Room No] WHERE (my condition)

I tried to use:
SELECT distinct SiteHotel.HotelID, SiteHotel.Logo, SiteHotel.HotelName, SiteHotel.Stars, SiteHotel.Theme, SiteHotel.City, SiteHotel.Location FROM SiteHotel INNER JOIN Room ON SiteHotel.HotelID = Room.HotelID INNER JOIN Reserve ON Room.[Room No] = Reserve.[Room No] WHERE (my condition)
but it dosn’t work

This discussion is locked

All Comments