7.3“新”GROUP BY 功能 (page 197) At times, it’s necessary to write SQL that appears as unruly as the convoluted example in Listing 7-5 so that the desired output can be obtained. The need for writing such unwieldy SQL has become much less frequent due to the advanced functionality Oracle has included in SQL the past few years. Much of what will be covered in this chapter is not actually new; it has been available for quite some time. 很多时候,写出的像列表7-5中复杂例子那么难整的SQL是必要的,只有这样才能得到想要的输出。由于Oracle在过去几年引入的高级功能,写出这样难控制的 SQL已经变得很不常见了。在本章中所阐述的很多内容实际上也不是什么新鲜玩意;已经有效了很长时间了。 You can start exploring some of the advanced grouping functionality in the Oracle database by experimenting with the CUBE and ROLLUP extensions to GROUP BY, and the GROUPING function. It takes a little effort to get started, as the benefits of newer functionality are not always clear until you spend some time learning to use them. 你探索ORACLE数据库的高级分组功能,可从GROUP BY的CUBE和ROLLUP扩展,以及GROUPING函数开始。入门容易,但是新功能的优势只有在你发了很多时间学习使用它们才能体会。 CUBE...
- @feng
1. 用java初始化一个ArrayList,中间处理最后输出: import java.util.List; import java.util.ArrayList; class Erase { private List filterLongerThan(List strings, int length) { List result = new ArrayList(); for (int i = 0; i < strings.size(); i++) { String s = (String) strings.get(i); if (s.length() <= length) { result.add(s); } } return result; } public static void main(String[] args) { List names = new ArrayList(); names.add("Ted"); names.add("Fred"); names.add("Jed"); names.add("Ned"); System.out.println(names); Erase e = new Erase(); List shortNames = e.filterLongerThan(names, 3); System.out.println(shortNames.size()); for (int i = 0; i < shortNames.size(); i++) { String s = (String) shortNames.get(i); System.out.println(s); } } } 执行结果: [Ted, Fred, Jed, Ned] 3 Ted Jed Ned 2. 经过Groovy语法,处理分号,处理import包. 代码如下: class Erase { private List filterLongerThan(List strings, intlength) { List result = new ArrayList() for (String s in strings) { if (s.length() <= length) { result.add(s) } } return result }...
- @feng