• Pelon (6/4/2013)


    Kingston Dhasian (6/4/2013)


    Something like this..

    SELECT*,

    CASE WHEN SUBSTRING(rate, 1, 1) = '*' THEN '10' ELSE SUBSTRING(rate, 1, 1) END AS game1,

    CASE WHEN SUBSTRING(rate, 2, 1) = '*' THEN '10' ELSE SUBSTRING(rate, 2, 1) END AS game2,

    CASE WHEN SUBSTRING(rate, 3, 1) = '*' THEN '10' ELSE SUBSTRING(rate, 3, 1) END AS game3,

    CASE WHEN SUBSTRING(rate, 4, 1) = '*' THEN '10' ELSE SUBSTRING(rate, 4, 1) END AS game4,

    CASE WHEN SUBSTRING(rate, 5, 1) = '*' THEN '10' ELSE SUBSTRING(rate, 5, 1) END AS game5

    FROMstudents

    That's amazing ! it really Works.

    thank you so much.

    Thanks for your help.

    Now I have a doubt, I would like to add the numbers of each column and after add them i want divide them to get the percent, for example:

    game1 game2 game3 game4 game5 percent

    8 + 9 + 7 + 8 + 10 / 8.4

    Thanks in advance.