When dealing with sophisticated business logic, you often need JOIN conditions that reference multiple tables already in your query—a capability that traditional BI tools struggle to handle intuitively.
Multi-condition joins occur when your JOIN conditions need to reference columns from multiple tables simultaneously. This gets especially tricky when:
Consider this scenario where you’re joining orders, customers, and shipping data. Your shipping table join depends not just on order IDs, but also needs to match the country from the customer table:
SELECT *
FROM orders o
JOIN customers c ON o.customer_id = c.id
JOIN shipping s ON s.order_id = o.id
AND s.country = c.country
AND s.priority = CASE
WHEN c.tier = 'premium' THEN 'express'
ELSE 'standard'
END
This type of join requires the system to understand that:
s.country references the customers table (c)SELECT *
FROM products p
JOIN categories cat ON p.category_id = cat.id
JOIN pricing pr ON pr.product_id = p.id
AND pr.region = cat.default_region
AND pr.effective_date <= CURRENT_DATE
JOIN discounts d ON d.product_id = p.id
AND d.category_id = cat.id
AND d.price_threshold < pr.base_price
Managing employee projects with temporal constraints requires careful join construction:
SELECT *
FROM employees e
JOIN departments d ON e.dept_id = d.id
JOIN projects p ON p.dept_id = d.id
JOIN assignments a ON a.employee_id = e.id
AND a.project_id = p.id
AND a.start_date >= e.hire_date
AND a.start_date >= p.kickoff_date
AND a.end_date <= p.deadline
The key innovation is natural language support for these complex joins. Instead of manually writing SQL or struggling with visual query builders, you can express your intent naturally, and Zing interprets the multi-table references intelligently.
With Zing, you can describe what you need: “Show me orders with shipping information, matching the customer’s country and priority based on their current plan status” and the system automatically constructs the appropriate multi-condition join.
You can define a multi-condition join with SQL and add it as an example in the console..
Alternatively, you can add a multi-condition join visually (adding multiple conditions to a ‘join group’ in the join editor within the app, or the console join creation tab.
Those saved joins and/or examples are then used for natural language questions as relevant context.
Available on iOS, Android, and the web
Learn how Zing can help you and your organization collaborate with data
Schedule Demo