Hi,
SELECT
article,
(SELECT IF((EXISTS(SELECT * FROM articles WHERE artnum LIKE CONCAT(article,'%red'))),1,0)) AS red,
(SELECT IF((EXISTS(SELECT * FROM articles WHERE artnum LIKE CONCAT(article,'%green'))),1,0)) as green,
(SELECT IF((EXISTS(SELECT * FROM articles WHERE artnum LIKE CONCAT(article,'%orange'))),1,0)) as orange
FROM fav
ORDER BY clicks DESC LIMIT 20Hat jemand eine Idee, wie ich das ganze beschleunigen kann?
ersetze erst mal das "%" durch ein "-".
Cheatah
--
X-Self-Code: sh:( fo:} ch:~ rl:| br:> n4:& ie:% mo:) va:) de:] zu:) fl:{ ss:) ls:~ js:|
X-Self-Code-Url: http://emmanuel.dammerer.at/selfcode.html
X-Will-Answer-Email: No
X-Please-Search-Archive-First: Absolutely Yes
X-Self-Code: sh:( fo:} ch:~ rl:| br:> n4:& ie:% mo:) va:) de:] zu:) fl:{ ss:) ls:~ js:|
X-Self-Code-Url: http://emmanuel.dammerer.at/selfcode.html
X-Will-Answer-Email: No
X-Please-Search-Archive-First: Absolutely Yes