I am attempting to write a query (mysql maria db) that pulls all rows from my main table (19m records) but also pulls categories / sub categories (in another table -> business_sub_category / categories).
I have written a number of inner joins into my statement to pull the tables but it appears that i have made a mistake. The below query only pulls 500 records. There are at least 7m emails.
Why is my query being limited to only 500 (thats how many get returned from this result set).
Even just giving me an idea of why my query might be limited would be very helpful. I'm new!
SELECT businesses_old.id, businesses_old.name, businesses_old.email, business_sub_category.sub_category_id, sub_categories.id, sub_categories.category_id, categories.id, categories.name FROM businesses_old INNER JOIN business_sub_category ON businesses_old.id = business_sub_category.id INNER JOIN sub_categories ON business_sub_category.id = sub_categories.id INNER JOIN categories ON sub_categories.category_id = categories.id WHERE email IS NOT NULL AND email <> '';