How would you get the second highest value from a table in DBMS?
Write a PostgreSQL query that returns the second highest distinct non-null value from the records table. Duplicate values should count once, and return NULL when a second distinct value does not exist.
second_highest_valuerecordsNULL if no second distinct value exists| Column | Type | Description |
|---|---|---|
| record_idPK | INT | Unique identifier for the record |
| value | NUMERIC(10,2) | Value used to determine the ranking |