Search code examples
jdbcderby

Is it possible to find maximum value of 2 or more column in a table?


for example : I have a table as follows

    id     math     science     english     history
    1       80        90           90         90
    2       70        60           81         78
    3       69        50           45         80
    4       30        40           10         80

i only want to find the maximum value in column math and science. Is it possible?


Solution

  • Simply use this :

    select max(science),max(math) from your_table