select * from CompanyDetails where LTRIM(RTRIM(REPLACE(company_name,' ','')))=LTRIM(RTRIM(REPLACE(@company_name,' ',''))) and country=@country and state=@state and LTRIM(RTRIM(REPLACE(city,' ','')))=LTRIM(RTRIM(REPLACE(@city,' ',''))) and category=@category