2015-12-19 35 views
0

我已經開發了市場網站使用CED擴展市場在magento。我的網站幾天前工作,但現在我面臨奇怪的問題在供應商商店頁面顯示錯誤網站的其餘部分工作正常。 當我打開的頁面它顯示語法錯誤問題在一頁磁電腦網站

SQLSTATE [42000]:語法錯誤或訪問衝突:1064您的SQL語法錯誤 ; AND(e.customer_group_id ='1')AND (e.min_price')查看與您的 MySQL服務器版本相對應的手冊,在第2行

查詢是:

SELECT FLOOR((ROUND((e.min_price) * 1, 2))/100) + 1 AS `range`, COUNT(*) AS `count` 
FROM `mage_catalog_product_index_price` AS `e` 
INNER JOIN `mage_catalog_category_product_index` AS `cat_index` 
    ON cat_index.product_id=e.entity_id AND cat_index.store_id='1' 
    AND cat_index.visibility IN(2, 4) 
    AND cat_index.category_id = '2' 
WHERE 1=1 
    AND (e.entity_id IN('1749', '1750', '1751', '1752', '1753', '1754', '1755', '1756', '1757', '1758', '1759', '1760', '1761', '1762', '1763', '1764', '1765', '1766', '1767', '1768', '1769', '1770', '1771', '1772', '1773', '1774', '1775', '1776', '1777', '1778', '1779', '1780', '1781', '1782', '1783', '1784', '1785', '1786', '1787', '1788', '1789', '1790', '1791', '1792', '1793', '1794', '1795', '1796', '1797', '1798', '1799', '1800', '1801', '1802', '1803', '1804', '1805', '1806', '1807', '1809', '1810', '1811', '1812', '1813', '1814', '1815', '1816', '1817', '1818', '1819', '1820', '1821', '1822', '1824', '1825', '1826', '1827', '1828', '1829', '1830', '1831', '1832', '1833', '1834', '1836', '1837', '1838', '1839', '1840', '1841', '1842', '1843', '1844', '1845', '1846', '1847', '1848', '1849', '1850', '1851', '1852', '1853', '1854', '1855', '1856', '1876', '1877', '1878', '1879', '1880', '1881', '1882', '1892', '1893', '1894', '1895', '1896', '1897', '1898', '1899', '1900', '1901', '1902', '1903', '1904', '1905')) 1=1 
AND (e.website_id = '1') 
AND (e.customer_group_id = '1') 
AND (e.min_price IS NOT NULL) 
GROUP BY FLOOR((ROUND((e.min_price) * 1, 2))/100) + 1 
ORDER BY FLOOR((ROUND((e.min_price) * 1, 2))/100) + 1 ASC 

誰能請告訴我在哪裏的問題將是

+0

SQLSTATE [42000]:語法錯誤或訪問衝突:1064您的SQL語法有錯誤;檢查與您的MySQL服務器版本相對應的手冊,以便在1和AND(e.website_id ='1')AND(e.customer_group_id ='1')AND(e.min_price'在第2行,查詢是:SELECT FLOOR((ROUND((e.min_price)* 1,2))/ 100)+ 1 AS'range',COUNT(*)AS'count' FROM'mage_catalog_product_index_price' as'e' INNER JOIN 'mage_catalog_category_product_index' as'cat_index' ON cat_index.product_id = e.entity_id AND cat_index.store_id ='1' – Indra

+2

請編輯您的問題,以包含您評論的全部細節 – Tristan

+0

我嘗試添加屏幕截圖,但不試試爲什麼它不添加雖然我自己添加錯誤 – Indra

回答

0

刪除1=1兩次(第一次後WHERE和第二後IN列表):

SELECT FLOOR((ROUND((e.min_price) * 1, 2))/100) + 1 AS range, 
     COUNT(*) AS COUNT 
FROM mage_catalog_product_index_price AS e 
JOIN mage_catalog_category_product_index AS cat_index 
    ON cat_index.product_id=e.entity_id 
AND cat_index.store_id='1' 
AND cat_index.visibility IN(2, 4) 
AND cat_index.category_id = '2' 
WHERE e.entity_id IN('1749', '1750', '1751', '1752', '1753', '1754', '1755', '1756', '1757', '1758', '1759', '1760', '1761', '1762', '1763', '1764', '1765', '1766', '1767', '1768', '1769', '1770', '1771', '1772', '1773', '1774', '1775', '1776', '1777', '1778', '1779', '1780', '1781', '1782', '1783', '1784', '1785', '1786', '1787', '1788', '1789', '1790', '1791', '1792', '1793', '1794', '1795', '1796', '1797', '1798', '1799', '1800', '1801', '1802', '1803', '1804', '1805', '1806', '1807', '1809', '1810', '1811', '1812', '1813', '1814', '1815', '1816', '1817', '1818', '1819', '1820', '1821', '1822', '1824', '1825', '1826', '1827', '1828', '1829', '1830', '1831', '1832', '1833', '1834', '1836', '1837', '1838', '1839', '1840', '1841', '1842', '1843', '1844', '1845', '1846', '1847', '1848', '1849', '1850', '1851', '1852', '1853', '1854', '1855', '1856', '1876', '1877', '1878', '1879', '1880', '1881', '1882', '1892', '1893', '1894', '1895', '1896', '1897', '1898', '1899', '1900', '1901', '1902', '1903', '1904', '1905') 
    AND e.website_id = '1' 
    AND e.customer_group_id = '1' 
    AND e.min_price IS NOT NULL 
GROUP BY FLOOR((ROUND((e.min_price) * 1, 2))/100) + 1 
ORDER BY range ASC 
+0

嗨,我需要編輯:( – Indra