SQL, get median of all columns in each row #eg21

SQL, get median of all columns in each row #eg21


In PostgreSQL database, table T has multiple numeric columns:


We want to find the median of all column values in each row. Below is the expected result:

Image description
Write the following SPL code:

Image description
new()function creates a new two-dimensional table; ~ represents the current record; array() function converts field values of a record to a sequence.



Source link
lol

By stp2y

Leave a Reply

Your email address will not be published. Required fields are marked *

No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.