I have a query
SQL Query SELECT YEAR(created_At) [YEAR], MONTH(created_at) [MONTH], COUNT(*) as Published_Articles FROM dbo.tasks GROUP BY YEAR(created_At), MONTH(created_at)
Which produces correct result when asked to run in Management Studio
Result
However, when I try to run the same query in laravel tinker, it doesn't run and it says year as an invalid column name but if you look at the query I am using correct alias. Not sure where I am going wrong and why it cannot output the same result as SQL Server Management studio.
tinker not accepting Alias
Can someone please give some direction, I am bit confused