|
|
SELECT DISTINCT AgencyID, @row:=@row+1 AS IDrank, agency_new.Name AS Name FROM rank LEFT JOIN agency_new ON ID=AgencyID LEFT JOIN country ON agency_new.CountryID=country.CountryID LEFT JOIN summary_postcode_map ON (agency_new.Outcode=summary_postcode_map.Postcode AND summary_postcode_map.CountryID=agency_new.CountryID) LEFT JOIN map_text AS state ON summary_postcode_map.StateID=state.loc_ID LEFT JOIN map_text AS county ON summary_postcode_map.CountyID=county.loc_ID LEFT JOIN map_text AS region ON summary_postcode_map.RegionID=region.loc_ID WHERE AgencyID!=341 AND Trading='Y' AND Publish='Y' AND DomainCode='uk' ORDER BY IDrank ASC LIMIT 10Table 'webshop.rank' doesn't exist |
|
|