PostgreSQL playground

  dense_rank() over w as rank,
  first_name, as dep_name,
from employee
  join department using(dep_id)
window w as (order by salary desc)
order by rank, emp_id;

PostgreSQL is a powerful, open source object-relational database system with a reputation for reliability, feature robustness, and performance.

⛫ homepage • αω tutorial • ⚘ community

Sandbox details

Postgres version:   16.2
sandbox engine:     codapi
sandbox name:       postgres
allowed commands:   run
in-browser:         via pglite

Usage example:

select 'Hello, World!' as message;

<codapi-snippet sandbox="postgres" editor="basic">