can i use MAX function for each tuple in the retrieved data set

Posted by kshama on Stack Overflow See other posts from Stack Overflow or by kshama
Published on 2010-03-28T12:07:40Z Indexed on 2010/03/28 12:13 UTC
Read the original article Hit count: 330

Filed under:

Hi, My table result contains fields:

id    count
____________
1     3
2     2
3     2
From this table i have to form another table **score** which should look as follows
id    my_score
___________
1     1.0000
2     0.6667
3     0.6667

That is my_score=count/MAX(count) but if i give the query as create TEMPORARY TABLE(select id,(count/MAX(count)) AS my_score from result); only 1 st row is retrieved.Can any one suggest the query so that my_score is calculated for all tuples. Thanks in advance.

© Stack Overflow or respective owner

Related posts about mysql