Multi GROUP BY merge
1, GROUPING SETS
Grouping sets allows the user to specify multiple column lists to group. Sets the column of the given word list that does not belong to the grouping column to NULL For example, the demand makes statistics on order sales by store grouping, order group grouping, store and order group grouping respectively, and obtains the result ...
Posted on Thu, 04 Nov 2021 09:23:39 -0400 by jmicozzi
Advanced Mysql - multi table query - foreign key constraint
Why have multiple watches? – create an employee table, including the following (id, name, age, dep_name, dep_location),id primary key, automatic growth, and add 5 pieces of data Code example:
CREATE TABLE emp (
id INT PRIMARY KEY auto_increment,
name VARCHAR(40),
age int,
dep_name VARCHAR(40),
dep_location VARCHAR(30)
);
INSERT INTO em ...
Posted on Wed, 03 Nov 2021 18:51:05 -0400 by lihman
In the same method, Mybatis requests the database multiple times. Do you want to create multiple SqlSession sessions?
Suddenly a question came to mind: every time we execute SQL Will create one SqlSession,Then in a transaction, multiple mapper Execute multiple sql,each sql Will be created sqlSession Are you?
Run a Demo test
Test whether a SqlSession will be created for each request when no transaction is added to the method: It can be seen from the log t ...
Posted on Wed, 03 Nov 2021 15:54:09 -0400 by idealbrain
SQL SELECT statement Basics
catalogue1, Column query2, Query all columns in the table3, Set alias for column4, Constant query5, Remove duplicate rows from results6, Select records according to the WHERE statement7, Writing method of notessee also
Learning focus
Use the SELECT statement to SELECT data from a table.
Set an alias for the column to display.
Constants o ...
Posted on Mon, 01 Nov 2021 21:14:07 -0400 by BLeez
T-SQL -- time operation function
catalogue0. Date and time type0.0 time type1. Conversion function1.1 CAST1.2 CONVERT2. Date operation function2.0 GETDATE and getutdate2.1 SYSDATETIME and SYSUTCDATETIME2.2 DATEADD2.3 DATEDIFF2.4 DATEPART and DATENAME2.5 YEAR, MONTH and DAY2.6 ISDATE3. Comprehensive use example3.1 age based on date of birth3.2 to be supplemented
Zhiming - Octob ...
Posted on Sun, 31 Oct 2021 10:56:02 -0400 by msk_1980
[RoarCTF 2019]Online Proxy - secondary injection, you again?
preface
It's really a time of trouble recently. For the first time, classes that usually don't leave homework have left homework recently. Recently, the rhythm of doing questions has been disrupted. Alas, I'm speechless. Later, I want to write an article about flash. I don't know when I will have a chance. Now I'd better focus on sql injection ...
Posted on Sat, 30 Oct 2021 09:40:54 -0400 by johng
PostGIS function table management function
Table management functions: help define tables with geometry fields
AddGeometryColumn
Add a field of geometry type to an existing table Function type: text
AddGeometryColumn(varchar table_name, varchar column_name,
integer srid, varchar type, integer dimension, boolean use_typmod=true);
AddGeometryColumn(varchar schema_name, varchar ta ...
Posted on Sat, 30 Oct 2021 07:50:42 -0400 by Dasndan
SQL injection code audit
0x00 introduction
Why do we study the first chapter? Because friends who read this article have probably read the file upload series I wrote earlier. If we come to SQL injection here, we can easily understand it. At the same time, SQL injection is also what we often want to find in audit. Since comparison, it is unrealistic to get shell, and t ...
Posted on Fri, 29 Oct 2021 18:59:54 -0400 by jrtaylor
Mo Tianlun openGauss free online SQL test virtual machine
Motianlun online training platform V1.0 is released. It provides a deployed database online environment for free. You can open the browser for learning anytime and anywhere and connect to the Linux WEB terminal with one click. At present, it supports Oracle, MySQL, Redis, PostgreSQL, openGauss and MogDB.
Adhering to the vision of knowing and e ...
Posted on Wed, 27 Oct 2021 23:35:23 -0400 by McChicken
[MySQL database] Chapter 5: stored procedure, function and process control structure
5 others
5.3 stored procedures and functions
Similar to C + + functions
5.3.1 stored procedure
Meaning: a set of SQL statements with pre compiled numbers (batch statements)
Benefits:
Improve code reusabilitySimplify operationThe compilation times are reduced, the connection times with the database server are reduced, and the efficiency is ...
Posted on Wed, 27 Oct 2021 20:14:40 -0400 by redking