sql - Search sort by parameter match count in the query? PostgreSQL -


I am working on a search query in PostgreSQL, and one of the tasks I make is matching me to a The clue is not how this can be done. Does anyone have any suggestions or solutions?

Color Brand Type of Engine Ford Blue4-Door V8 Maserati Blue 2-Door V12 Saturn Green 4-Door V8 GM Yellow 1 Door V4 Select Current Question (2 Matches) Saturn ( 2 matches) Maserati (1 match) / div>

I think you have to Order by case: when color = 'blue' then 1 ELSE 0 END + case when type = '4-door' then 1 ELSE 0 END + case when the engine = ' V8 'then 1 ELSE 0 END DESC


Comments