select * from admin.v_generate_tbl_ddl where schemaname ='nameofschema' and tablename='nameoftable';
If the view v_generate_tbl_ddl is not in your admin schema, you can create it using below sql provided by the AWS Redshift team.
https://github.com/awslabs/amazon-redshift-utils/blob/master/src/AdminViews/v_generate_tbl_ddl.sqlt-database/
Reference:
https://awsbytes.com/how-to-get-the-ddl-of-a-table-in-redshift-database/