|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 3:00 AM
Points: 1,151,
Visits: 879
|
|
Thanks to all for the positive comments and thanks Hugo for the logical explanation you gave. Helps a lot!
Tom please tell me what this means. "Na tog mi gun tuit mi ach ma thuiteas tog! Thig crìoch air an t-saoghal ach mairidh gaol is ceòl "
Manie Verster Developer Johannesburg South Africa
Life is about choices.... I choose to be happy today
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 3:22 AM
Points: 5,244,
Visits: 7,059
|
|
Manie Verster (9/10/2010) Tom please tell me what this means. "Na tog mi gun tuit mi ach ma thuiteas tog! Thig crìoch air an t-saoghal ach mairidh gaol is ceòl " Google translate recognises it as Scottish Celtic, but is not yet able to translate that to either English or Dutch. Bing Translator thinks it's Hungarian and translates it to English as "Na train what gun tuit what ach thuiteas train today! Thig crìoch air an t-saoghal ach mairidh gaol also ceòl". Guess which of the two competing sites I believe
Hugo Kornelis, SQL Server MVP Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 11:05 AM
Points: 7,109,
Visits: 7,182
|
|
Manie Verster (9/10/2010) Tom please tell me what this means. "Na tog mi gun tuit mi ach ma thuiteas tog! Thig crìoch air an t-saoghal ach mairidh gaol is ceòl " As Hugo said, it's Scotland's Celtic language, usually in English called Scottish Gaelic, or Gaelic for short (which of course creates confusion with Manx and Irish Gaelics) or in itself Gàidhlig na h-Alba. The first line means literally "Don't lift me unless I fall but if I fall do lift" but really "don't correct me unless I'm wrong but if I'm wrong do". The second line is a very old saying: "An end will come upon the world but love and music will survive".
Tom Is minic a gheibheann béal oscailte dorn dúnta. Is minig a cheapas beul fosgailte dòrn dùinte.
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: 2 days ago @ 1:10 PM
Points: 2,673,
Visits: 2,418
|
|
| I was up late last night working. I am looking at the question and thinking, "Gee, I didn't think you could group that way" and in my fatigue I chose the wrong answer instead of realizing that you can't group that way.
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Today @ 1:49 AM
Points: 10,990,
Visits: 10,540
|
|
There is a "workaround":
SELECT DV.[Year], SOH.SalesPersonID, AverageOrderAmt = SUM(SOH.TotalDue) FROM Sales.SalesOrderHeader SOH CROSS APPLY (SELECT DATEPART(yyyy,OrderDate)) DV ([Year]) GROUP BY DV.[Year], SOH.SalesPersonID ORDER BY DV.[Year] ; Over to you, Hugo.
Paul
Paul White SQL Server MVP SQLblog.com @SQL_Kiwi
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Monday, January 14, 2013 6:20 AM
Points: 69,
Visits: 131
|
|
| Great question and even better follow up discussions. Thanks!
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Monday, August 20, 2012 10:20 AM
Points: 197,
Visits: 98
|
|
| Based on Hugo's LOGICAL progression where the group by preceeds the select. The alias is not yet defined so grouping is not possible against a column that does not yet exist. The Order By occurs post Select where the alias has been defined so it is acceptable. An alternative solution is Group by datepart(yyyy,orderdate).
|
|
|
|