I have an SQL statement which Joins 3 tables and then produces some results.
PROBLEM: DB Fiddle actually gives me the correct results BUT My Database: Version: 10.0.38-MariaDB – Gives different results.
Both DBs show all 48 rows when the `sale_category=’Non-Productive’
BUT – Only DB Fiddle filters correctly to 15 rows of data when the `sale_category=’Non-Productive’
My MariaDB filters incorrectly resulting in 32 rows of data. (see attached)
My database is displaying results which should be filtered (e.g. any row with sale_type=CUSTOMER) BUT is showing them as ‘Non-Productive’ and I have no idea why (especially after testing in DB Fiddle and seeing desired results)
1. Why is it so?2. Is there a more efficient SQL query?