Get the last row that was left outside of a timeframed SQL query Is there a way to write a SQL query with a timeframe condition to include the latest row that is outside of the timeframe (besides solutions like counting the size of the result set and querying for the size+1, etc.) ?

Lets say I have a table A, which holds timestamped value changes. 
I want to query for all the changes in the last 24 hours (assume that the time when the query was ran on 8/8/19 00:00) - how do I include the last row that isn't included in 24-hours interval, i.e., row #2 (assuming I don't know when it occurred):

CREATE TABLE A(`timeframe` datetime, `value` int);


INSERT INTO A 
    (`timeframe`, `value`)
VALUES
    ('2019-08-06 15:00:00', 10),
    ('2019-08-06 23:00:00', 20),
    ('2019-08-07 14:00:00', 50),
    ('2019-08-07 16:00:00', 10),
    ('2019-08-07 22:35:00', 30),
    ('2019-08-07 23:00:00', 40);


| timestamp        | value |
|------------------|-------|
| 2019-08-06 15:00 | 10    |
| 2019-08-06 23:00 | 20    |
| 2019-08-07 14:00 | 50    |
| 2019-08-07 16:00 | 10    |
| 2019-08-07 22:35 | 30    |
| 2019-08-07 23:00 | 40    |


SELECT value,time FROM A WHERE time &gt;= DATE_SUB(NOW(), INTERVAL 1 DAY)


The result set should include the value changes in last day (rows #3-#6) and the latest row outside the timeframe - row #2.
The simplest (I think so) solution is

  ( SELECT * 
    FROM A
    WHERE `timestamp` BETWEEN @from AND @till )
UNION ALL
  ( SELECT * 
    FROM A
    WHERE `timestamp` &lt; @from
    ORDER BY `timestamp` DESC LIMIT 1 )
ORDER BY `timestamp` ASC


Alternative:

WITH cte AS ( SELECT `timestamp`, `value`, 
                     LEAD (`timestamp`) OVER (ORDER BY `timestamp`) `next`
              FROM A )
SELECT `timestamp`, `value`
FROM cte
WHERE (`timestamp` BETWEEN @from AND @till)
   OR (`next` BETWEEN @from AND @till)
ORDER BY `timestamp` ASC


One more:

WITH cte AS ( SELECT `timestamp`, `value`, 
                     CASE WHEN `timestamp` &gt;= @from THEN 1
                          ELSE ROW_NUMBER() OVER (ORDER BY `timestamp DESC`)
                     END grp
              FROM A
              WHERE `timestamp` &lt;= @till )
SELECT `timestamp`, `value`
FROM cte
WHERE grp = 1
ORDER BY `timestamp` ASC


One more else:

WITH cte AS ( SELECT `timestamp`, `value`, 
                     COALESCE(LEAD(`timestamp`) OVER (ORDER BY `timestamp DESC`),
                              `timestamp`) grp
              FROM A
              WHERE `timestamp` &lt;= @till )
SELECT `timestamp`, `value`
FROM cte
WHERE grp &gt;= @from
ORDER BY `timestamp` ASC