比较SQL表中的三列以获得中间值

use*_*455 4 sql

我需要在sql表中显示三列的中间值.

例如:对于数据

col1    col2    col3
759     736     773
Run Code Online (Sandbox Code Playgroud)

那么输出应该是759.

最好的方法是什么?

Boh*_*ian 5

对于Oracle,MySql和Postgres:

select col1 + col2 + col3 - greatest(col1, col2, col3) - least(col1, col2, col3)
Run Code Online (Sandbox Code Playgroud)