Google Answers Logo
View Question
 
Q: How to do calculation with mysql alias variable ( No Answer,   0 Comments )
Question  
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?
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

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 Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy