Hey,
Sort by clause performs on column names of Hive tables to sort the output, We can mention DESC for sorting the order in descending order and mention ASC for Ascending order of the sort.
For instance, if column types are numeric it will sort in numeric order if the columns types are string it will sort in lexicographical order.
Query you can use:
SELECT * from table_name SORT BY Id DESC;