select a.companyid,companyname,b.productid,b.companyproductid,b.producttitle,productthumbimagepath,a.country,d.eBusinessName,c.categoryid,a.city, CASE b.Productdesc When NULL THEN a.activities When '' THEN a.activities ELSE b.productdesc END as proddesc, CASE When d.eBusinessName >'' THEN 0 ELSE 10 END as score,categoryname,a.activities as activities1 ,MATCH (b.productdesc,b.producttitle,a.activities) AGAINST ('+Merchant +Importers' )as score1 from mstcompanies a left join trncompanyproduct b on a.companyid=b.companyid inner join mstproduct c on b.productid=c.productid LEFT JOIN mstcategory e ON c.categoryid=e.categoryid left join trncompanywebstore d on a.companyid=d.companyid where ((MATCH (b.productdesc) AGAINST ('"Merchant Importers"')> 7) OR (MATCH (b.productdesc,b.producttitle,a.activities) AGAINST ('+Merchant +Importers' ))) ,score1 desc