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 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			633 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			633 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
#
 | 
						|
# Test MIN as distributed aggregate function
 | 
						|
# Author: Bharath, bharath.bokka@mariadb.com
 | 
						|
#
 | 
						|
-- source ../include/have_columnstore.inc
 | 
						|
 | 
						|
--disable_warnings
 | 
						|
DROP DATABASE IF EXISTS mcs191_db;
 | 
						|
--enable_warnings
 | 
						|
 | 
						|
CREATE DATABASE mcs191_db;
 | 
						|
USE mcs191_db;
 | 
						|
 | 
						|
CREATE TABLE t1 (a INT, b CHAR(5))ENGINE=Columnstore;
 | 
						|
INSERT INTO t1 VALUES (NULL, ''),(1, 'aaa'),(2, 'aaa'),(1, 'ccc'),(4, 'ddd'),(5, 'aaa'),(6, 'ddd'),(7, 'eee');
 | 
						|
 | 
						|
SELECT MIN(DISTINCT a) FROM t1;
 | 
						|
SELECT MIN(DISTINCT a) FROM t1 GROUP BY b HAVING b = 'aaa';
 | 
						|
SELECT b, MIN(DISTINCT a) FROM t1 GROUP BY b ORDER BY b DESC;
 | 
						|
SELECT MIN(a) FROM t1;
 | 
						|
 | 
						|
# Clean UP
 | 
						|
DROP DATABASE mcs191_db;
 |