for an exstention controller of a VF page, I need to build a query to retrieve all the lead with a Company name similar to a variable. My variable name is compagnia: Now I'm trying to build the query like this:
String query='select Id,Company from Lead where Company like'+ '%'+compagnia+'%'
List <Lead> l=Database.query(query);
But the query doesn't work, how Can I solve this problem?