Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
How do I load the last 100 rows of a particular field example datetime below?
Example:
[MyTable]: LOAD data AS data1, timestamp((timestamp/86400 + 25569 + 8/24),'DD/MM/YYYY h:mm:ss[.fff] TT') as datetime; SELECT `data`, `timestamp`, FROM myDB.`myTable`;
Try this?
[MyTable]: LOAD data AS data1, timestamp((timestamp/86400 + 25569 + 8/24),'DD/MM/YYYY h:mm:ss[.fff] TT') as datetime; SELECT `data`, `timestamp`, FROM myDB.`myTable`;
Final:
NoConcatenate
First 100 Load * Resident MyTable order by data1 asc, datetime asc;
Drop Table MyTable;
Try this?
[MyTable]: LOAD data AS data1, timestamp((timestamp/86400 + 25569 + 8/24),'DD/MM/YYYY h:mm:ss[.fff] TT') as datetime; SELECT `data`, `timestamp`, FROM myDB.`myTable`;
Final:
NoConcatenate
First 100 Load * Resident MyTable order by data1 asc, datetime asc;
Drop Table MyTable;
Hi,
Do I need to order by data1 asc too? I just want to order by datetime.
I tried to order by only date time but am getting the first 100 loads.
Not sure, Why you are not simply copy paste and check? First take that as priority, If still problem we may ask sample application.
Hi,
Sorry, the date was still wrong.
Using the exact syntax as above and using the "Final" table to see the datetime data, I have datetime from 2018-10-10 10:00:00 to 2018-10-11 21:00:00.
The expected date should be from 2018-11-14 04:00:00 to 2018-11-14 16:00:00.
that means, below one is not working.
Timestamp((timestamp/86400 + 25569 + 8/24),'DD/MM/YYYY h:mm:ss[.fff] TT') as datetime;