In the doc, we can retrieve history by date, but how to retrieve minimum date for all tables on that ledger?
I tried this:
SELECT MIN(h.metadata.txTime) FROM history(Clients) AS h
but it gives error: <UNKNOWN>: at line <UNKNOWN>, column <UNKNOWN>: <UNKNOWN>; Expected number: 2021-08-04T12:24:07.921Z
it seems MIN
function only can receives number but there's no way to convert timestamp to epoch/unix timestamp?
also
SELECT MIN(TO_STRING(h.metadata.txTime,'yyyyMMddHHmmss.SSS')) FROM history(Clients) AS h
<UNKNOWN>: at line <UNKNOWN>, column <UNKNOWN>: <UNKNOWN>; Expected number: "20210804122407.921"
(tried postgresql cast style ::float
also didn't work)
EDIT: nevermind, there's CAST
SELECT MIN(CAST(TO_STRING(h.metadata.txTime,'yyyyMMddHHmmss.SSS') AS float)) FROM history(Clients) AS h
this one works, but hopefully the float is accurate enough to represent timestamp.
back to the question, how to retrieve from all table?
Table1 | minTxTime
Table2 | minTxTime
Table3 | minTxTime