You've already forked mariadb-columnstore-engine
							
							
				mirror of
				https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
				synced 2025-10-30 07:25:34 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			387 B
		
	
	
	
		
			SQL
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			387 B
		
	
	
	
		
			SQL
		
	
	
	
	
	
| -- $ID$
 | |
| -- TPC-H/TPC-R Small-Quantity-Order Revenue Query (Q17)
 | |
| -- Functional Query Definition
 | |
| -- Approved February 1998
 | |
| :x
 | |
| :o
 | |
| select
 | |
| 	sum(l_extendedprice) / 7.0 as avg_yearly
 | |
| from
 | |
| 	lineitem,
 | |
| 	part
 | |
| where
 | |
| 	p_partkey = l_partkey
 | |
| 	and p_brand = ':1'
 | |
| 	and p_container = ':2'
 | |
| 	and l_quantity < (
 | |
| 		select
 | |
| 			0.2 * avg(l_quantity)
 | |
| 		from
 | |
| 			lineitem
 | |
| 		where
 | |
| 			l_partkey = p_partkey
 | |
| 	);
 | |
| :n -1
 |