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 
			
		
		
		
	
		
			
				
	
	
		
			51 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			51 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
USE tpch1;
 | 
						|
drop table if exists a1;
 | 
						|
drop table if exists a2;
 | 
						|
create table a1 (c1 int, c2 int)engine=columnstore;
 | 
						|
create table a2 (c1 int, c2 int)engine=columnstore;
 | 
						|
insert into a1 values (1, 1),(2,2),(3,null),(null,3),(null,null);
 | 
						|
insert into a2 values (1, 1),(2, null),(null, 2),(3, 3),(null, null);
 | 
						|
select * from a1 where c1 not in (select c2 from a2);
 | 
						|
c1	c2
 | 
						|
select * from a1 where c1 not in (select c2 from a2 where a1.c2=a2.c2);
 | 
						|
c1	c2
 | 
						|
3	NULL
 | 
						|
NULL	NULL
 | 
						|
select * from a1 where not exists (select c2 from a2 where a1.c2=a2.c2 and a1.c1=a2.c1);
 | 
						|
c1	c2
 | 
						|
2	2
 | 
						|
3	NULL
 | 
						|
NULL	3
 | 
						|
NULL	NULL
 | 
						|
select * from a1 where not exists (select c2 from a2 where a1.c2=a2.c2);
 | 
						|
c1	c2
 | 
						|
3	NULL
 | 
						|
NULL	NULL
 | 
						|
select * from a1 where (c1,c2) not in (select c1,c2 from a2 where a2.c1 > a1.c2);
 | 
						|
c1	c2
 | 
						|
1	1
 | 
						|
2	2
 | 
						|
3	NULL
 | 
						|
NULL	3
 | 
						|
NULL	NULL
 | 
						|
select * from a1 where c1 not in (select c2 from a2 where a1.c2>a2.c2);
 | 
						|
c1	c2
 | 
						|
1	1
 | 
						|
2	2
 | 
						|
3	NULL
 | 
						|
NULL	NULL
 | 
						|
select * from a1 where c1 not in (select 1 from a2 where a1.c1=a2.c1);
 | 
						|
c1	c2
 | 
						|
2	2
 | 
						|
3	NULL
 | 
						|
NULL	3
 | 
						|
NULL	NULL
 | 
						|
select count(*) from a1 where c1 not in (select c2 from a2 where a1.c2=a2.c2);
 | 
						|
count(*)
 | 
						|
2
 | 
						|
select count(*) from a1 where not exists (select c2 from a2 where a1.c2=a2.c2 and a1.c1=a2.c1);
 | 
						|
count(*)
 | 
						|
4
 | 
						|
drop table a1;
 | 
						|
drop table a2;
 |