470,594 Members | 1,101 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,594 developers. It's quick & easy.

ORDER BY 5*(column LIKE ' term') + 4*(column LIKE ' term')

I am trying to find some documentation on using things like ORDER BY
5*(column LIKE ' term') + 4*(column LIKE ' term')

I don't even know what it is called so it is difficult to search. My
questions is... Is the value before the * like a multiplier? So I could
give more weight to one column than another by raising that number?

I am trying to return a result that searches 5 or 6 columns and column
1 needs to have by far the most weight, 2 the second amount of weight
and so on. I thought this worked but lets say i am searching for the
word "cooking" like below

Order By 6*(book_title LIKE '%cooking"%') + 5*(book chapter LIKE
'%cooking%') + 4*(book_author LIKE '%cooking%') + 3*(book_text LIKE
'%cooking%') + 2*(book_publisher LIKE '%cooking%') +
1*(book_pulish_date) desc

The problem is if the word "cooking" is in the book_title once, but in
the book_text like 20 times, the book_text is returned first, i always
want the title to have more precedence even if it only contains
"cooking" once.

Thanks for any help.


Sep 12 '06 #1
0 2224

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Laurence Breeze | last post: by
1 post views Thread by Thomas Schoen | last post: by
3 posts views Thread by andreas ames | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.