BrickTracker/bricktracker/sql/minifigure/list/last.sql
2025-01-17 11:03:00 +01:00

18 lines
391 B
SQL

{% extends 'minifigure/base/select.sql' %}
{% block total_missing %}
SUM(IFNULL(missing.quantity, 0)) AS total_missing,
{% endblock %}
{% block join %}
LEFT JOIN missing
ON minifigures.fig_num IS NOT DISTINCT FROM missing.set_num
AND minifigures.u_id IS NOT DISTINCT FROM missing.u_id
{% endblock %}
{% block group %}
GROUP BY
minifigures.fig_num,
minifigures.u_id
{% endblock %}