tqla Posted July 18, 2007 Share Posted July 18, 2007 Hi. I get duplicates in my results becuase the relationship of the two databases in 1 to many. How can I add DISTINCT to this select statement? "SELECT * FROM Clients cl INNER JOIN CompaniesNew co ON co.ClientNum = cl.ID WHERE co.Year = '2007' AND co.Publish = 'Y'"); Thanks. Quote Link to comment Share on other sites More sharing options...
jvrothjr Posted July 18, 2007 Share Posted July 18, 2007 You have to state which field is distinct "select distinct cl.Name from clients cl inner join CompaniesNew co on co.ClientNum = cl.ID where co.Year = '2007' and co.Publish = 'y'" Quote Link to comment Share on other sites More sharing options...
tqla Posted July 18, 2007 Author Share Posted July 18, 2007 Perfect. Thanks jvrothjr! This topic is solved! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.