Seen below is the code of how I would create a volatile table when I was coding in Teradata. I liked it because it would be the same structure and format as a normal query, but it would make a temporary table. More specifically, I like how I do not have to specify every single column and data type. I am trying to figure out how to make a similar temporary table in Azure Data Studio without having to define all of my columns. I do not have too much SQL experience and my skills are relatively basic, so any help is appreciated. Thanks!
drop table #t_table; create volatile table #t_table as ( SELECT patient.ID, patient.age, patient.sex, ICD.PrimaryICDCode FROM QP.patient LEFT JOIN QP.ICD ON ICD.ID = patient.ID WHERE patient.age > 30 ) with data on commit preserve rows;