Search
 
SCRIPT & CODE EXAMPLE
 

SQL

last date for each user sql

select t.username, t.date, t.value
from MyTable t
inner join (
    select username, max(date) as MaxDate
    from MyTable
    group by username
) tm on t.username = tm.username and t.date = tm.MaxDate
Comment

PREVIOUS NEXT
Code Example
Sql :: insert json file to mssql 
Sql :: postgres meta command to show all rows in table 
Sql :: mysql row generator 
Sql :: sql alias 
Sql :: how to update linked server in sql server 
Sql :: get string between specific character sql 
Sql :: postgresql insert multiple rows 
Sql :: row number sql 
Sql :: acual month sql 
Sql :: postgres sql alter table delete row 
Sql :: import sql file to mysql db using shell commands 
Sql :: Find the names of sailors who have reserved a red boat, and list in the order of age 
Sql :: mysql stored procedure insert if not exists 
Sql :: sql quary intervewi question 
Sql :: description query in sql 
Sql :: insert into from 
Sql :: drop unique 
Sql :: what is primary key 
Sql :: select into oracle 
Sql :: tables in sql 
Sql :: joint query 
Sql :: how to left join a sub query in postgresql 
Sql :: search from comma separated values in sql server 
Sql :: selecting all columns from table sql database 
Sql :: like operator in sql 
Sql :: sql like operator 
Sql :: sql check if column exists 
Sql :: insert into 
Sql :: oracle database status v$logfile 
Sql :: grant privileges mysql to database 1064 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =