Ich habe Abfrage mit Verknüpfungen (in magento):Wie kann der berechnete Bodenwert bei Auswahl mit Joins gefiltert werden, wenn er nicht null ist?
SELECT FLOOR(rating.rating_summary/20) AS `rating_value`,
COUNT(*) AS `count`
FROM `catalog_product_flat_3` AS `e`
INNER JOIN `catalogsearch_result` AS `search_result` ON search_result.product_id=e.entity_id
AND search_result.query_id='218'
INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id
AND price_index.website_id = '1'
AND price_index.customer_group_id = 0
INNER JOIN `review_entity_summary` AS `rating` ON rating.entity_pk_value = e.entity_id
AND rating.store_id = 0;
Es benötigt wird, um Zeilen mit NULL, um herauszufiltern in rating_value
oder count < 1
+--------------+-------+
| rating_value | count |
+--------------+-------+
| NULL | 0 |
+--------------+-------+
1 row in set (0,00 sec)
aber aus irgendeinem Grund, wo ich WHERE count > 0
oder rating_value IS NOT NULL
es versuchen sagt, dass Betreff Spalte rating_value
, count
nicht existiert, was mache ich falsch?
Vielen Dank!