"从n中选择id,firstname,lastname,其中姓氏为(''Eastwood'',''Scwarzenegger''),按名字命名" 这给了我结果 2 Arnold Scwarzenegger 3 Clint Eastwood 4 Helen Eastwood 5 Tim Scwarzenegger 但是我想要这个: 3 Clint Eastwood 4 Helen Eastwood 2 Arnold Scwarzenegger 5 Tim Scwarzenegger 即: 1:按姓氏分组 2:list-clause中第一个指定的姓氏也是结果中首先列出的 姓氏组。 我在上面的问题: 1.如何分组数据。 2.如何订购分组(例如:Eastwood group come.before Scwarzenegger) 3.我的数据包含无法分组的字段(ntext) 希望你知道我现在的意思:) - 问候, Summa Ok? It was just example an statement...but suppose I have this table: Table n:id intfirstname ntextlastname ntext There are 5 records in that table (listed as id,firstname,lastname): 1 Tom Jensen2 Arnold Scwarzenegger3 Clint Eastwood4 Helen Eastwood5 Tim Scwarzenegger My select MUST include a clause on the lastnames that gives me theopportunity to specify them as a list - like this: "Select id, firstname, lastname from n where lastname in(''Eastwood'',''Scwarzenegger'') order by firstname" That gives me the result2 Arnold Scwarzenegger3 Clint Eastwood4 Helen Eastwood5 Tim Scwarzenegger But I want this:3 Clint Eastwood4 Helen Eastwood2 Arnold Scwarzenegger5 Tim Scwarzenegger That is:1: Grouped by lastname2: The lastname specified first in the list-clause is also thelastname-group that is listed first in the result.My problems int the above:1. How to group the data.2. How to order the groupings (eg: Eastwood group comes.beforeScwarzenegger)3. My data contains fields that cant be Grouped (ntext) Hope u know what I mean now :)--regards,Summa 这篇关于Goup by子句混淆....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-26 23:40