SQL to get the document type, document type id, category code, sub-category code, and legislation code

Each document type has a unique ID, a category code, a sub-category code, a legislation code, and a creation date
The following query will select all the columns from the table and sort them by the creation date in descending order

select system_document_type,
document_type_id,
category_code,
sub_category_code,
legislation_code,
creation_date
from hr_document_types_b
order by creation_date  desc;

This query can be useful for finding the most recent document types that have been added to the system
It can also help to identify the categories, sub-categories, and legislations that are associated with each document type

I hope this blog post was helpful for you. If you have any questions or feedback, please leave a comment below.