Forum Discussion
Fazlullah
Mar 21, 2024Copper Contributor
Select column from table that column name contains specific keyword
Hi, I need help on writing SQL query to select only column names that contains specific year. For ex , I have a table with 100+ columns where I have 4 columns for each quarter for every year, lik...
olafhelper
Mar 22, 2024Bronze Contributor
It's not possible with a simple SQL statement, you would have to use dynamic SQL, see https://www.sommarskog.se/dynamic_sql.html