Use ROW_NUMBER()
:
SELECT s.id,s.tag,s.version FROM (
SELECT t.*,
ROW_NUMBER() OVER(PARTITION BY t.id ORDER BY t.version DESC) as rnk
FROM YourTable t) s
WHERE s.rnk = 1
More Related Contents:
- GROUP BY with MAX(DATE) [duplicate]
- 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
- Select latest row for each group from oracle
- SQL Query output in VBA is different than in SQL Oracle
- I want to find out how much zero come after 1 in SQL
- Select first row in each GROUP BY group?
- How to use the ‘as’ keyword to alias a table in Oracle?
- Stored Procedure with optional “WHERE” parameters
- subquery in FROM must have an alias
- SQL multiple columns in IN clause
- How can I select from list of values in Oracle
- Selecting the second row of a table using rownum
- sqlplus statement from command line
- Does Oracle store trailing zeroes for Number data type?
- Oracle Update Query using Join
- How to convert Rows to Columns in Oracle? [duplicate]
- Autoincrement in oracle to already created table
- SQL not displaying null values on a not equals query?
- What can cause an Oracle ROWID to change?
- How to add ‘ON DELETE CASCADE’ in ALTER TABLE statement
- Oracle query to match all values in the list among all rows in table
- Inserting into Oracle and retrieving the generated sequence ID
- How do I call an Oracle stored procedure from an Excel VBA script?
- Oracle DB: How can I write query ignoring case?
- Oracle Convert TIMESTAMP with Timezone to DATE
- SQL Server equivalent of WM_CONCAT function [duplicate]