0

I've came cross a SQL SELECT statement which is different than what I normally see:

Select Distinct [Employee: Department_key_historic],[Employee: Department_key_current]
From [shared].[vw_Table]

What does the colon do in the above code? I am used to see format like Select table.columnName but never a :

Selim Yildiz
  • 5,254
  • 6
  • 18
  • 28
Mich
  • 19
  • 1
  • 1
    which dbms are we talking about* – Derviş Kayımbaşıoğlu Sep 11 '20 at 13:23
  • 1
    There is no colon in the code. It is in the middle of a column name. – Gordon Linoff Sep 11 '20 at 13:25
  • Take a look at the actual column names in `[shared].[vw_Table]` and I can almost guarantee that those column names have colons in them. The colon in the column name is treated no differently than the underscore or the space in the column name; since they're inside square brackets, they're just the column name. – Ross Presser Sep 11 '20 at 13:34

1 Answers1

1

This appears to be a SQL Server query. If that is the case, [] are used to surround object names. Therefore the : that you see are simply part of the name of the column itself.

Rob
  • 2,080
  • 4
  • 28
  • 48