- This topic is empty.
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
Empowering Insights, Unleashing Possibilities
Data Science/Business Analytics for Small Business Applications › Forums › SQL › Why showing duplicate rows
Need to find all orders in 2015.
Here is my query:
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.
Reply
https://community.spiceworks.com/topic/2458634-why-showing-duplicate-rows?page=1#entry-10182771