SQL_Query Error

Hi @km81

SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'YourSheetName$'
AND COLUMN_NAME <> 'ColumnToExclude'

In this query:

  • INFORMATION_SCHEMA.COLUMNS is a system table that stores information about columns in your Excel sheet.
  • TABLE_NAME = 'YourSheetName specifies the sheet you’re working with. Replace 'YourSheetName with the name of your Excel sheet.
  • COLUMN_NAME <> 'ColumnToExclude' excludes the specific column you want to exclude. Replace 'ColumnToExclude' with the actual column name you want to exclude.

This query retrieves the names of all columns except the one you want to exclude dynamically.specifies the sheet you're working with. Replace DISCOURSE_PLACEHOLDER_3` with the name of your Excel sheet.

Hope it helps!!

2 Likes