group by and union all

SELECT ‘vacation’ AS keyCode, staff.staff_id AS staffId, staff.staff_name AS staffName, SUM(DATEDIFF(LEAST(staff.end_time, #{endDate}), GREATEST(staff.begin_time, #{startDate}))) AS vacationDays, NULL AS lateDays, NULL AS absenceDays, NULL AS attendanceDays FROM tb_staff_stop_receive_time AS staff WHERE staff.stop_type = 1 AND (staff.begin_time BETWEEN #{startDate} AND #{endDate} OR staff.end_time BETWEEN #{startDate} AND #{endDate}) GROUP BY staff.staff_id UNION ALL SELECT ‘late’ AS keyCode, […]

Custom types: structure, enumeration, union

Table of Contents Structure 1 Declaration of structure 1.1 Basic knowledge of structure 1.2 Declaration of structure 1.3 Special Statement 1.4 Self-reference of structures 1.5 Definition and initialization of structure variables 1.6 Structure memory alignment 1.7 Modify the default alignment number 1.8 Structure parameter passing 2. bit segment 2.1 What is a bit segment? 2.2 […]

C language structures and unions

C language structure Concept of structure In C language, you can set up a data type structure composed of different types of data. This combined data structure is a structure. Understand the code based on the video: Video introducing structures Structure Case Video: Case Reference article: Introduction to structures #include<stdio.h> #include<stdlib.h> #include<string.h> //strcut tells the […]

(Database) Java implementation of relational (i.e. table) intersection and union (relational algebra) operations (including code and files)

Table of Contents 1.What is cross-over? 2. How to optimize operations 3. Table storage format 4. Required tables and table descriptions 5. Data table file example 6. Implement the code 6.1 Table class 6.2 Test class 1. What is cross-over and Union expands (but does not duplicate) Difference Different minus elements Intersection repeating elements 2. […]

Oracle table joins (inner joins, outer joins (left joins, right joins), implicit joins, table unions, table intersections, table complements)

Oracle table join, inner join, outer join (left join, right join, full join), implicit join, table union, table intersection, table complement 1. Inner join inner join 1.The difference between and and where 2. Inner association implicit writing method (Oracle proprietary) 3. Cross connection–Cartesian product connection in conclusion: 2. Outer connection 1. left join left join […]

Custom types: structure, enumeration, union

Table of Contents Structure Basic knowledge of structures structure declaration special statement Self-referencing of structures Definition and initialization of structure variables Structure memory alignment Modify the default alignment number Structure parameter passing Rank What is bit segment Bit segment memory allocation Cross-platform issues with bit segments Bit segment applications enumerate Definition of enumeration type Advantages […]

Find the intersection, difference and union of two object Lists based on their attributes – General plus version

Background Based on work needs, Code Brother wrote a solution method for the intersection, union, and complement of List objects a long time ago (the intersection and difference set of two object Lists are obtained based on attributes), and found that many friends have similar needs, and Code recently happened to When I have time, […]

Custom types (structure, union, enumeration)

Detailed explanation of custom types Custom types include: structure, union, and enumeration. Detailed directory Detailed explanation of custom types Structure 1. Declaration of structure type 1.1 Basic knowledge of structures 1.2 Keywords of structures 1.3 Declaration of structure 1.4 Self-reference of structure 1.5 Use typedef keys to rename structures 2. Creation and initialization of structure […]

Custom types: (structure, enumeration, union)

1 Declaration of structure 1.1 Basic knowledge of structure A structure is a collection of values called member variables. Each member of the structure can be a variable of different types. 1.2 Declaration of structure struct tag //tag is a custom value { //member list member-list; }variable-list; //variable list For example, describe a student: struct […]