You are here: Re: Select row with only ONE occurence « MsSQL Server « IT news, forums, messages
Re: Select row with only ONE occurence

Posted by figital on 03/02/06 15:53

The reason you are getting both rows back is because f1 is not
identical in each. You need to remove f1 from the group by and add an
aggregator to the select list.

Something like this:

select max(f1), f2
from table1
inner join table2 on table1.id = table2.fid
where .....
group by f2
having count(f2) = 1

 

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

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