mirror of
				https://github.com/grocy/grocy.git
				synced 2025-10-31 02:36:54 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			7 lines
		
	
	
		
			179 B
		
	
	
	
		
			SQL
		
	
	
	
	
	
			
		
		
	
	
			7 lines
		
	
	
		
			179 B
		
	
	
	
		
			SQL
		
	
	
	
	
	
| CREATE VIEW stock_current
 | |
| AS
 | |
| SELECT product_id, SUM(amount) AS amount, MIN(best_before_date) AS best_before_date
 | |
| FROM stock
 | |
| GROUP BY product_id
 | |
| ORDER BY MIN(best_before_date) ASC
 |