SELECT fs.*, fc.image clubImage, fc.seo clubSEO, IF(fc.name <> '', fc.name, fs.clubName) clubName, fc.abbr clubAbbr FROM football_standings fs LEFT JOIN football_clubs fc ON (fs.club = fc.id) WHERE fs.league = ORDER BY fs.position