<dtml-comment>
title:
connection_id:MySQL
max_rows:100000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT DISTINCT catalog.relative_url, catalog.path
FROM catalog, catalog as master_item, category, stock
WHERE category.uid=stock.uid
AND category.base_category_uid = <dtml-var "portal_categories.aggregate.uid">
AND category.category_uid = catalog.uid
AND stock.node_uid = <dtml-var "portal_categories.site.Stock_MP.Gravelines.uid">
AND stock.quantity > 0
AND catalog.parent_uid = master_item.uid
AND master_item.portal_type = "Piece Tissu"
AND catalog.portal_type = "Piece Tissu"