Home T-SQL min function with alias for column header
Reply: 0

T-SQL min function with alias for column header

user514
1#
user514 Published in July 21, 2018, 9:50 am

If I do the following in SSMS 2008 r2, using T-SQL:

SELECT TOP 1 [col1] 
FROM [table1] AS ourResult

The alias column header ourResult works as expected.

However, if I do the very similar:

SELECT MIN([Date]) 
FROM [table1] AS min_date1 

the alias for the column header does not work and instead there is:

(No column name)

Is there a fix for this somewhat simple situation?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.320291 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO