|
|
Subject:
How to do calculation with mysql alias variable
Category: Computers > Programming Asked by: mmaker-ga List Price: $5.00 |
Posted:
04 Jul 2005 22:46 PDT
Expires: 03 Aug 2005 22:46 PDT Question ID: 540027 |
My objective: I have a database that I search using fulltext queries. I search both address fields and city-state fields for which I create aliases. I want to give more weight to a positive result score in the city-state field. How can I introduce a multiplier to the alias? For instance, I would like to do something like this (creating a new alias called total_score which is address_score + city_state_score * multiplier). The query below is not valid: SELECT *, MATCH ('table.address') AGAINST ('keyword') AS address_score, MATCH ('table.city_state') AGAINST ('keyword') AS city_state_score, (address_score + city_state_score * 2) AS total_score WHERE MATCH ('table.address') AGAINST ('keyword') AND MATCH ('table.city_state') AGAINST ('keyword') ORDER BY total_score Is there any way to do something like this? |
|
There is no answer at this time. |
|
There are no comments at this time. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |