test sql

0

Please login or register to vote for this query.

(click on this box to dismiss)

Amateur Radio

Q&A for amateur radio enthusiasts

declare @table table
(day datetime,
mark int, 
name varchar(10), 
cost int, 
salecategory varchar(10), 
costcategory varchar(10))

insert @table values('2019-01-01',10, 'pete',20, 'b', 'b')


SELECT 
LAG(day) OVER (
        PARTITION BY name
        ORDER BY day) previous_salary
FROM @table

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results