SELECT orders.occurred_at, accounts.name, orders.total, orders.total_amt_usd
FROM orders
JOIN accounts
ON orders.account_id = accounts.id
JOIN web_events
ON accounts.id = web_events.account_id
JOIN sales_reps
ON accounts.sales_rep_id = sales_reps.id
JOIN region
ON sales_reps.region_id = region.id
WHERE orders.occurred_at BETWEEN '01-01-2015' AND '01-01-2016'
Here is the output:
Unable to figure out why showing duplicate rows. Just because I have joined more columns than actually needed for the problem creating this issue? Is so, an explanation will help how so. Any clue appreciated.