Hi, I have the following query i'm trying to execute:
SELECT CONCAT_WS(' ', g.genus_name, s.species_name, i.rank, i.infraspecies_name, conf.auth1, conf.auth2 ) AS scientific_name,
cn.common_name, GROUP_CONCAT(cn.common_name ORDER BY cn.common_name SEPARATOR ', ' ) AS common_names, ui.unvouch_image_src, ui.unvouch_image_alt, gh.growth_habit, gd.gen_distrib_name
FROM plants AS p
LEFT JOIN (genera AS g, species AS s)
ON (p.genus_num = g.genus_id AND p.species_num = s.species_id)
LEFT JOIN (confirmations AS conf)
ON (p.plant_id = conf.plant_num)
LEFT JOIN (plant_growth_habits AS pgh, growth_habits AS gh)
ON (p.plant_id = pgh.plant_num)
LEFT JOIN (plant_distributions AS pd, gen_distribs AS gd)
ON (p.plant_id = pd.plant_num)
LEFT JOIN (plant_common_names AS pcn, common_names AS cn)
ON (p.plant_id = pcn.plant_num)
LEFT JOIN (unvouchered_images AS ui)
ON (p.plant_id = ui.plant_num)
LEFT JOIN (infraspecies AS i)
ON (p.infraspecies_num = i.infraspecies_id)
WHERE scientific_name LIKE '%sesuvium%'
GROUP BY scientific_name ORDER BY scientific_name
I only recently added the last 3/4 join statements but before those it was working, i'm not sure if there's a problem with my joins/join syntax any help would be greatly appreciated.