Do a full join
This commit is contained in:
		
							parent
							
								
									ba5927cc52
								
							
						
					
					
						commit
						b675200690
					
				| @ -157,7 +157,7 @@ WITH raffles AS | ||||
|      JOIN item i on store_item.item_id = i.id | ||||
|      WHERE store_id = @sid AND store_item.unlisted = false) | ||||
| SELECT * FROM raffles | ||||
| INNER JOIN (SELECT item_id, count(*) AS total FROM inventory_item | ||||
| FULL JOIN (SELECT item_id, count(*) AS total FROM inventory_item | ||||
|             WHERE item_id = ANY (SELECT raffle_id FROM raffles) | ||||
|             GROUP BY item_id) total_raffles ON total_raffles.item_id = raffle_id; | ||||
|         """ | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user