I am trying to delete the first & last row with Java HyperAPI which i used to optimise big data into .hyper file. in tableau server. Im not sure if this possible but based on the documentation, some of the use cases i read , its possible
based on normal sql query , we can delete the first row with
delete top(1) from tablename
Script shown below is working fine which is able to remove row based on where condition
long rowCountDeletedInCustomersTable = connection.executeCommand(
"DELETE FROM " + escapeName("Customer") +
"WHERE " + escapeName("Customer Name") + "=" + escapeStringLiteral("Dennis Kane")
).getAsLong();
however when i tried to delete the first with
long rowCountDeletedInCustomersTable = connection.executeCommand(
DELETE TOP(1) from " + escapeName("Customer")).getAsLong()
or
long rowCountDeletedInCustomersTable = connection.executeCommand(
DELETE FROM table WHERE ROWNUM = 1).getAsLong()
this will throw error, im not sure on which approach should i use