clear markdown compare help donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 541811 fiddles created (11238 in the last week).

CREATE TABLE tab AS SELECT '0000-00-00 00:00:00' AS time, 'GOOGLE' AS company, 40 AS quote UNION SELECT '2012-07-02 21:28:05' , 'GOOGLE' , 60 UNION SELECT '2012-07-02 21:28:51' , 'SAP' , 60 UNION SELECT '2012-07-02 21:29:05', 'SAP' , 20
 hidden batch(es)


SELECT company, quote, LAG(quote) OVER(PARTITION BY company ORDER BY time) AS prev_quote FROM tab
company quote prev_quote
GOOGLE 40
GOOGLE 60 40
SAP 60
SAP 20 60
 hidden batch(es)