yugabyte=# SELECT * FROM some_data ORDER BY created_ts;
id | the_data | created_ts
----+-----------+----------------------------
1 | Old Data1 | 2024-05-23 13:28:16.955521
2 | Old Data2 | 2024-05-23 13:28:17.173187
3 | New Data3 | 2024-05-23 13:28:30.593381
4 | New Data4 | 2024-05-23 13:28:32.175775
(4 rows)
yugabyte=# SELECT the_data FROM some_data ORDER BY created_ts DESC LIMIT 1 \gset
yugabyte=# \echo :the_data
New Data4
yugabyte=# SELECT * FROM some_data WHERE the_data = :'the_data';
id | the_data | created_ts
----+-----------+----------------------------
4 | New Data4 | 2024-05-23 13:28:32.175775
(1 row)