)--------------BUS 1, 1610000OPE 1320000SAL 1, 4936000SUP 10150008881000
SQL>
Let's take a look at what happens if you use normal group by without ROLLUP.
SQL> select pision_id, sum (salary)2 from employees23 group by pision_id4 order by pision_id;
Div sum (SALARY)--------------BUS 1, 1610000OPE 1320000SAL 1, 4936000SUP 1015000
The final statistics are missing.
2. Pass multiple columns to ROLLUP
SQL> select pision_id, job_id, sum (salary)2 from employees23 group by rollup (pision_id, job_id)4
order by division_id, job_id;
Div job sum (salary)-----------------Bus Mgr 530000Bus pre 800000Bus wor 280000Bus 1, 1610000OPE Eng 245000OPE Mgr 805000OPE wor 270000OPE 1320000Sal Mgr 4446000Sal wand 490000Sal 1, 4936000
Div job sum (salary)-----------------Sup Mgr 465000Sup TEC 115000Sup wor 435000Sup 10150008881000
16 rows selected.
As you can see, in addition
You can use the GROUPING_ID function to filter records with the HAVING clause, removing records that do not contain subtotal or total. The GROUPING_ID () function can accept one or more columns and return the decimal value of the GROUPING bit vector. The calculation method of the GROUPING bit vector is to combine the results of calling the GROUPING function for each column in sequence. 1. GROUPING_ID usage instance SQL> select 2 division_id, job_id, 3 grouping (division_id) as div_grp, 4 groupin
You can use the grouping_id function to filter records with the having clause, removing records that do not contain subtotal or total. The grouping_id () function can accept one or more columns and return the decimal value of the grouping bit vector. The calculation method of the grouping bit vector is to combine the results of calling the grouping function for each column in sequence.
For details about how to use the grouping function, refer to the article I wrote earlier.
Http://blog.csdn.net
After all the information in the database can be traversed and displayed, the page is displayed on the JSP page.
// Add nodes implemented by PAGE
FunctionPagesnode (pageshtmlnode, rootnode ){
// Obtain the current page
VaRNowpage = rootnode. getattribute ("nowpage ");
// Obtain the total number of pages
VaRCountpage = rootnode. getattribute ("countpage ");
// Obtain the total number of records
VaRCountsize = rootnode. getattribute ("countsize ");
VaRMsgnode = Document. createtextnode ("current"
(function (res) {$state. Go ("Appliance_index");
});
}else{//prompts to select the device var alertpopup = $ionicPopup. Alert ({title: ' Home Appliance Repair ', template:response.msg});
Alertpopup.then (function (res) {});
}
});
/confirm the reservation submitted data formdata:{}}; });
Jump to a new page and inject repairdevicedatashareserver into controller
Appointment time Controller angular.module ("Sqhapp"). Controller ("Orderdatecontroller", ["$scope", "$state", ' $ion
think that the previous 0 and 1 are too boring to represent any meaning. To put it bluntly, it is not human-friendly. At this time, we can use case to convert to some meaningful values.
SQL > Select 2 Case Grouping (Division_id) 3 When 1 Then ' All divisions ' 4 Else Division_id 5 End As Div, 6 Sum (Salary) 7 From Employees2 8 Group By Rollup (division_id) 9 Order By Division_id; Div Sum (Salary) -- ---------------------- Bus 1610000 OPE 1320
. Use Case to convert the return value of grouping ()
Maybe you will think that the previous 0 and 1 are too boring to represent any meaning. To put it bluntly, it is not human-friendly. At this time, we can use case to convert to some meaningful values.
SQL> select2 case grouping (division_id)3 when 1 then 'all divisions'4 else division_id5 end as Div,6 sum (salary)7 from employees28 group by rollup (division_id)9 order by division_id;
Div sum (salary)------------------------Bus 1, 1610000OPE 1
, but I have not heard of the call start. "This may have many questions. Indeed, the current computer can basically enable the power of incoming calls, but we do not use this function at ordinary times. We can even use the power-on function in the office to open the computer in our home and download the necessary files, and then shut down the computer in our home. Maybe you still don't believe that computers will be so intelligent? If you don't believe it, try it with me! Of course, it also requ
group of data under the number of N (1OutputFor each group of data for the group, output the shortest time for all tasks to complete. The specific output format is shown in the sample, beginning with case, after case output the current data ordinal, and then output the answer.Sample Input32 53 22 133 34 4 5 50Sample OutputCase 1:8case 2:15#include #include#includeusing namespacestd;structnode{intB,j;} wor[1005];BOOLCMP (Node w1,node W2) {returnW1.j>W
bluntly, it is not human-friendly. At this time, we can use CASE to convert to some meaningful values.
SQL> select2 case grouping (division_id)3 when 1 then 'all divisions'4 else division_id5 end as div,6 sum (salary)7 from employees28 group by rollup (division_id)9 order by division_id;
Div sum (SALARY)------------------------BUS 1, 1610000OPE 1320000SAL 4936000SUP 1015000All divisions 8881000
3. Use CASE and GROUPING () to convert values of multiple columns
SQL> select2 case grouping (divisio
A string is a topic center.
Number A string
In many cases, we have to manipulate each character in the string (see what follows), and one of the things that must be done to do it exactly is to number the characters. For example, there are 50 students in a class, and if the students have a number, the teacher will simplify a lot of things. For example, do not look for each person's name, directly through the study number to know who has not handed in homework.
In Python, the string is numbered i
Familiar with Python (3) and familiar with python
String is a topic center.
ID of a string
In many cases, we need to perform operations on each character in the string (see the following content for details). To perform operations accurately, we must perform the task of numbering the characters. For example, if there are 50 students in a class and all of these students have student IDs, it is much easier for teachers to operate on them. For example, you don't need to look for the name of each pe
A string is a topic center.
Number to String
In many cases, we all have to operate on each character in the string (see later), and to do exactly that, one of the tasks that must be done is to number the characters. For example, there are 50 students in a class, if these students have a number, the teacher to operate them will simplify a lot. For example, do not have to look for each person's name, directly through the school number to know who has not handed in homework.
In Python, the strin
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.