3 ms·
Are you familiar with what the SQL for the following PRQL looks like? from employees group role ( sort join_date take 1 ) It's pre
by pie_flavor 3y ago
Are you familiar with what the SQL for the following PRQL looks like?
from employees
group role (
sort join_date
take 1
)
It's pretty complicated and annoying. There's loads of attempts to reinvent SQL, but PRQL is the only one that's designed for what SQL is actually for, and fixes real problems instead of 'ick' problems.
- jeroen79 3y agono, i can't read PRQL, and a have no interest in learning it, it also doesn't really matter if it is a few lines more, if that means more people can read and understand it.
- _dain_ 3y agosomething like select * from employees qualify row_number() over ( partition by role order by join_date ) = 1 although I don't disagree with you. and `qualify` isn't standard SQL iirc
- pie_flavor 3y agoRight, if you don't have QUALIFY you need a nested SELECT with named outputs within a WITH. (The example is taken from the website.)