SELECT COUNT(*) AS `no` from home%" then 0.8 else 0 end) + (case when meta_title LIKE "%work from home%" then 0.8 else 0 end) + (case when descriere_scurta LIKE "%work from home%" then 0.6 else 0 end) + (case when descriere_lunga LIKE "%work from home%" then 0.6 else 0 end) + (case when titlu LIKE "%work%" then 0.4 else 0 end) + (case when descriere_scurta LIKE "%work%" then 0.2 else 0 end) + (case when descriere_lunga LIKE "%work%" then 0.2 else 0 end) + (case when titlu LIKE "%from%" then 0.4 else 0 end) + (case when descriere_scurta LIKE "%from%" then 0.2 else 0 end) + (case when descriere_lunga LIKE "%from%" then 0.2 else 0 end) + (case when titlu LIKE "%home%" then 0.4 else 0 end) + (case when descriere_scurta LIKE "%home%" then 0.2 else 0 end) + (case when descriere_lunga LIKE "%home%" then 0.2 else 0 end) + (case when keywords LIKE "%home%" then 0.6 else 0 end) as Weight,produse.id_produs,id_subcateg,subcategorie,titlu,meta_title,poza_mare,type_produs,anul, produse.keywords,produse.promotie,produse.promotie_fara_tva,produse.pret,produse.pret_fara_tva,produse.start_promotie,produse.end_promotie, produse.tva,ROUND((produse.pret_fara_tva*((CAST(produse.tva AS BINARY) / 100)+1)),2) as produs_pret_calculat, descriere_scurta,descriere_lunga,stoc FROM produse,subdomeniu,domeniu_tip as p1 INNER JOIN (SELECT * FROM domeniu_tip GROUP BY id_produs HAVING MAX(id_domeniu_tip)) p2 ON p1.id_domeniu_tip = p2.id_domeniu_tip WHERE produse.id_produs=p1.id_produs AND subdomeniu.id_subcateg=p1.id_subcategorie AND p1.id_categorie="5" AND produse.rs_ro="Da" AND ( produse.titlu LIKE "%work from home%" OR produse.meta_title LIKE "%work from home%" OR produse.descriere_scurta LIKE "%work from home%" OR produse.descriere_lunga regexp "([ \t\n\r\f\v])work from home([ \t\n\r\f\v])" OR produse.keywords LIKE "%work from home%" OR produse.titlu LIKE "%work%" OR produse.meta_title LIKE "%work%" OR produse.descriere_scurta LIKE "%work%" OR produse.descriere_lunga regexp "([ \t\n\r\f\v])work([ \t\n\r\f\v])" OR produse.keywords LIKE "%work%" OR produse.titlu LIKE "%from%" OR produse.meta_title LIKE "%from%" OR produse.descriere_scurta LIKE "%from%" OR produse.descriere_lunga regexp "([ \t\n\r\f\v])from([ \t\n\r\f\v])" OR produse.keywords LIKE "%from%" OR produse.titlu LIKE "%home%" OR produse.meta_title LIKE "%home%" OR produse.descriere_scurta LIKE "%home%" OR produse.descriere_lunga regexp "([ \t\n\r\f\v])home([ \t\n\r\f\v])" OR produse.keywords LIKE "%home%" )
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%" then 0.8 else 0 end) + (case when meta_title LIKE "%work from home%" then 0.' at line 1