For example, you can get a count out of the database for the number of respondents who have stated that their favorite color (question 2) is red by using the following query shown in Listing 10.
例如,使用下面的清单10中的查询,您可以从数据库中查询最喜欢的颜色是红色(问题2)的回答者的数目。
As an example, let's count employees grouped by office, in other words, the number of employees in each office.
作为示例,让我们计算一下按办公室分组的员工数量,换句话说,就是各办公室中的员工数量。
For our example, let's say we want to count the number of documents grouped by the name value.
例如,我们要按name值来分组计算文档数。
Thus, the script does not count 10 lines, it counts 10 iterations of the loop generated by the -n switch (see "perldoc perlrun" and Listing 2 for an example of that loop).
运算符在一个范围内迭代。因此,该脚本并不是数10个行,而是对- n开关生成的循环迭代10次(请参阅“perldocperlrun”和清单2,以获得该循环的示例)。
Thus, the script does not count 10 lines, it counts 10 iterations of the loop generated by the -n switch (see "perldoc perlrun" and Listing 2 for an example of that loop).
运算符在一个范围内迭代。因此,该脚本并不是数10个行,而是对- n开关生成的循环迭代10次(请参阅“perldocperlrun”和清单2,以获得该循环的示例)。
应用推荐