Possible Duplicate:
Simple way to calculate median with MySQL
I need find the median of each corresponding id value in mysql. Means i need to get like median of 1=3 and median of 2=5 and median of 3=7.Can any one help me..? Thanks in advance.
id | val
--------
 1    4
 3    7
 1    2
 2    2
 3    9
 2    8
 3    3
 
    