SELECT train, dest, time FROM (
SELECT train, dest, time,
RANK() OVER (PARTITION BY train ORDER BY time DESC) dest_rank
FROM traintable
) where dest_rank = 1
More Related Contents:
- Select first row in each GROUP BY group?
- ORA-00979 not a group by expression
- Return row with the max value of one column per group [duplicate]
- Get top results for each group (in Oracle)
- Fetch the row which has the Max value for a column
- Oracle SQL query: Retrieve latest values per group based on time [duplicate]
- Fetch the rows which have the Max value for a column for each distinct value of another column
- Selecting all corresponding fields using MAX and GROUP BY
- SQL: getting the max value of one column and the corresponding other columns [duplicate]
- SQL not a single-group group function
- Get values from first and last row per group
- Why doesn’t Oracle SQL allow us to use column aliases in GROUP BY clauses?
- Select latest row for each group from oracle
- Receive an unexpected symbol error in my PLSQL query [closed]
- SQL Query to concatenate column values from multiple rows in Oracle
- Oracle SQL, concatenate multiple columns + add text
- Oracle Joins – Comparison between conventional syntax VS ANSI Syntax
- SQL Error: ORA-01861: literal does not match format string 01861
- Using ORDER BY and GROUP BY together
- Determine Oracle null == null
- SELECT INTO using Oracle
- SQL server select distinct rows using most recent value only
- `show create table` equivalent in oracle sql
- Query json dictionary data in SQL
- ORA-00972 identifier is too long alias column name
- Return number from Oracle Select statement after parsing date
- How do you interpret a query’s explain plan?
- How to call Oracle MD5 hash function?
- SQL Server equivalent of WM_CONCAT function [duplicate]
- Oracle: ‘= ANY()’ vs. ‘IN ()’