SQL median function
Moderator: NorbertKrupa
SQL median function
Is there a SQL function to calculate the median of a number set?
- JimKnicely
- Site Admin
- Posts: 1825
- Joined: Sat Jan 21, 2012 4:58 am
- Contact:
Re: SQL median function
There is!
In my favorite Vertica client tool vsql, you can use a wild card search to find a function using the \df meta-command:
In my favorite Vertica client tool vsql, you can use a wild card search to find a function using the \df meta-command:
Code: Select all
dbadmin=> \df *median*
List of functions
procedure_name | procedure_return_type | procedure_argument_types
----------------+------------------------+--------------------------
median | Float | Float
median | Float | Integer
median | Float | Numeric
median | Interval Day to Second | Interval Day to Second
median | Interval Year to Month | Interval Year to Month
(5 rows)
Jim Knicely
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.