4 lines
		
	
	
		
			157 B
		
	
	
	
		
			SQL
		
	
	
	
	
	
			
		
		
	
	
			4 lines
		
	
	
		
			157 B
		
	
	
	
		
			SQL
		
	
	
	
	
	
| select contentid, count(*) howmany, min(fromtype) mnfrom, max(fromtype) mxfrom
 | |
| from parts
 | |
| group by contentid
 | |
| having min(fromtype) <= 2 and max(fromtype) >= 3 |