You've already forked mariadb-columnstore-engine
							
							
				mirror of
				https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
				synced 2025-11-03 17:13:17 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			69 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			69 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
USE tpch1;
 | 
						|
drop table if exists uriage_inf;
 | 
						|
create table uriage_inf(eigyo_shimei varchar(20),uriage numeric) engine=columnstore default charset=utf8;
 | 
						|
insert into uriage_inf values('SMITH',1000);
 | 
						|
insert into uriage_inf values('ALLEN',2000);
 | 
						|
insert into uriage_inf values('JONES',3000);
 | 
						|
insert into uriage_inf values('SMITH',4000);
 | 
						|
insert into uriage_inf values('BLAKE',5000);
 | 
						|
drop table if exists uriage_my;
 | 
						|
create table uriage_my (eigyo_shimei varchar(20),uriage numeric) engine=myisam default charset=utf8;
 | 
						|
insert into uriage_my values('SMITH',1000);
 | 
						|
insert into uriage_my values('ALLEN',2000);
 | 
						|
insert into uriage_my values('JONES',3000);
 | 
						|
insert into uriage_my values('SMITH',4000);
 | 
						|
insert into uriage_my values('BLAKE',5000);
 | 
						|
SELECT
 | 
						|
T1.`eigyo_shimei`,SUM(-5)
 | 
						|
FROM
 | 
						|
URIAGE_inf T1
 | 
						|
GROUP BY
 | 
						|
T1.`eigyo_shimei`
 | 
						|
ORDER BY
 | 
						|
T1.`eigyo_shimei`;
 | 
						|
eigyo_shimei	SUM(-5)
 | 
						|
ALLEN	-5
 | 
						|
BLAKE	-5
 | 
						|
JONES	-5
 | 
						|
SMITH	-10
 | 
						|
SELECT
 | 
						|
T1.`eigyo_shimei`,SUM(5)
 | 
						|
FROM
 | 
						|
URIAGE_inf T1
 | 
						|
GROUP BY
 | 
						|
T1.`eigyo_shimei`
 | 
						|
ORDER BY
 | 
						|
T1.`eigyo_shimei`;
 | 
						|
eigyo_shimei	SUM(5)
 | 
						|
ALLEN	5
 | 
						|
BLAKE	5
 | 
						|
JONES	5
 | 
						|
SMITH	10
 | 
						|
SELECT
 | 
						|
T1.`eigyo_shimei`,SUM(-5)
 | 
						|
FROM
 | 
						|
URIAGE_my T1
 | 
						|
GROUP BY
 | 
						|
T1.`eigyo_shimei`
 | 
						|
ORDER BY
 | 
						|
T1.`eigyo_shimei`;
 | 
						|
eigyo_shimei	SUM(-5)
 | 
						|
ALLEN	-5
 | 
						|
BLAKE	-5
 | 
						|
JONES	-5
 | 
						|
SMITH	-10
 | 
						|
SELECT
 | 
						|
T1.`eigyo_shimei`,SUM(5)
 | 
						|
FROM
 | 
						|
URIAGE_my T1
 | 
						|
GROUP BY
 | 
						|
T1.`eigyo_shimei`
 | 
						|
ORDER BY
 | 
						|
T1.`eigyo_shimei`;
 | 
						|
eigyo_shimei	SUM(5)
 | 
						|
ALLEN	5
 | 
						|
BLAKE	5
 | 
						|
JONES	5
 | 
						|
SMITH	10
 | 
						|
drop table uriage_inf;
 |