Select previous value in row without using a subquery
As Akina has pointed out in comments LAG() function requires an ORDER BY clause to show the properly values.

Given the next example:

CREATE TABLE t (id int, bar int);

INSERT INTO t VALUES
(1, 7),
(2, 8),
(3, 30),
(4, 25),
(5, 24),
(6, 24),
(7, 35),
(8, 40);


You can get the previous bar value ordering by id, (if you don't set an order, what is the previous row?)

SELECT
    id,
    bar,
    LAG(bar) OVER (ORDER BY id)
FROM
    t;

id | bar |  lag
-: | --: | ---:
 1 |   7 | null  --&lt;&lt; Note the NULL value
 2 |   8 |    7
 3 |  30 |    8
 4 |  25 |   30
 5 |  24 |   25
 6 |  24 |   24
 7 |  35 |   24
 8 |  40 |   35


Then simply use a conditional statement IF or CASE

SELECT
    id,
    bar,
    CASE 
        WHEN LAG(bar) OVER (ORDER BY id) &lt; bar THEN 'Lower'
        WHEN LAG(bar) OVER (ORDER BY id) &gt; bar THEN 'Higher'
        WHEN LAG(bar) OVER (ORDER BY id) = bar THEN 'Equal'
        ELSE 'Nothing to compare'
    END As Previous
FROM
    t;

id | bar | previous          
-: | --: | :-----------------
 1 |   7 | Nothing to compare
 2 |   8 | Lower             
 3 |  30 | Lower             
 4 |  25 | Higher            
 5 |  24 | Higher            
 6 |  24 | Equal             
 7 |  35 | Lower             
 8 |  40 | Lower            


db&lt;>fiddle here