BrickTracker/bricktracker/sql/minifigure/list/using_part.sql

25 lines
570 B
MySQL
Raw Normal View History

2025-01-17 11:03:00 +01:00
{% extends 'minifigure/base/select.sql' %}
{% block total_quantity %}
SUM("minifigures"."quantity") AS "total_quantity",
{% endblock %}
2025-01-17 11:03:00 +01:00
{% block where %}
WHERE "minifigures"."fig_num" IN (
2025-01-17 11:03:00 +01:00
SELECT
"inventory"."set_num"
FROM "inventory"
2025-01-17 11:03:00 +01:00
WHERE "inventory"."color_id" IS NOT DISTINCT FROM :color_id
AND "inventory"."element_id" IS NOT DISTINCT FROM :element_id
AND "inventory"."part_num" IS NOT DISTINCT FROM :part_num
2025-01-17 11:03:00 +01:00
GROUP BY "inventory"."set_num"
2025-01-17 11:03:00 +01:00
)
{% endblock %}
{% block group %}
GROUP BY
"minifigures"."fig_num"
{% endblock %}