Distinct on multiple fields
Marketing wants to understand customer purchase frequency by looking at unique customer-date combinations. This will help them spot patterns in buying behavior across different time periods.
Use the AI assistant to generate a query that shows distinct customer-date pairs.
Diese Übung ist Teil des Kurses
Introduction to SQL with AI
Anleitung zur Übung
- Give the AI a clear instruction to return each unique combination of customer ids and order dates.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
SELECT customer_id
FROM orders;