imri Posted August 31, 2011 Share Posted August 31, 2011 Hey there! I need help writing a special SQL query. I have a table of Events, every event contains a user-id, which is the id of the creator. Every user in my website chooses 3 colors he likes. I want to select Events from the events table, ordering it by colors match - an event, which it's creator's colors match my colors best, will be "ranked" higher. For example, if John created an event X, and John's colors are Green, Red and Yellow, and my colors are Red, Orange and Yellow, his event will be higher in the results list, than event which Paul created, because Paul's favorite colors are Black, Blue and Red. There is a users-colors table, which consists of user-id and color-id. I hope I explained myself best. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
fenway Posted September 1, 2011 Share Posted September 1, 2011 What if some of the colours match? 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.