Title: Getting SQL error
Last modified: July 14, 2021

---

# Getting SQL error

 *  [devendrahashtag](https://wordpress.org/support/users/devendrahashtag/)
 * (@devendrahashtag)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/getting-sql-error/)
 * I am getting below sql error in my error_log file.
    “WordPress database error
   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 ‘[188) GROUP BY ikaanya_braapf_product_variation_attributes.
   post_id ) as filtered’ at line 1 for query SELECT filtered_post.id, filtered_post.
   out_of_stock, COUNT(filtered_post.ID) as post_count FROM ( SELECT filtered_post.*,
   max_filtered_post.max_meta_count, IF(max_filtered_post.max_meta_count != filtered_post.
   meta_count OR stock_table.out_of_stock_init = 1, 1, 0) as out_of_stock FROM (
   SELECT ikaanya_braapf_product_variation_attributes.post_id as var_id, ikaanya_braapf_product_variation_attributes.
   parent_id as ID, COUNT(ikaanya_braapf_product_variation_attributes.post_id) as
   meta_count FROM ikaanya_braapf_product_variation_attributes WHERE ikaanya_braapf_product_variation_attributes.
   meta_value_id IN (0,270cat,type[188) GROUP BY ikaanya_braapf_product_variation_attributes.
   post_id ) as filtered_post INNER JOIN ( SELECT post_id as ID, COUNT(post_id) 
   as max_meta_count FROM ikaanya_braapf_variation_attributes WHERE taxonomy IN (‘
   pa_use’) GROUP BY post_id ) as max_filtered_post ON max_filtered_post.ID = filtered_post.
   ID LEFT JOIN ( SELECT ikaanya_braapf_product_stock_status_parent.post_id as id,
   IF(ikaanya_braapf_product_stock_status_parent.stock_status = 1, 0, 1) as out_of_stock_init
   FROM ikaanya_braapf_product_stock_status_parent GROUP BY id ) as stock_table 
   ON filtered_post.var_id = stock_table.id GROUP BY filtered_post.ID, out_of_stock)
   as filtered_post GROUP BY filtered_post.ID HAVING post_count = 1 AND out_of_stock
   = 1 made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-
   loader.php’), include(‘/themes/adiva-child/woocommerce/archive-product.php’),
   dynamic_sidebar, WP_Widget->display_callback, BeRocket_new_AAPF_Widget_single-
   >widget, BeRocket_AAPF_Widget->__construct, berocket_aapf_get_terms, BeRocket_AAPF_get_terms::
   get_terms, apply_filters(‘berocket_aapf_get_terms_filter_after’), WP_Hook->apply_filters,
   BeRocket_AAPF_get_terms::recount_products, apply_filters(‘berocket_aapf_recount_terms_apply’),
   WP_Hook->apply_filters, BeRocket_AAPF_faster_attribute_recount::recount_terms,
   BeRocket_AAPF_faster_attribute_recount::recount_terms_without_prepare, apply_filters(‘
   berocket_aapf_recount_terms_query’), WP_Hook->apply_filters, BeRocket_AAPF_compat_woocommerce_variation-
   >faster_recount_add_data, apply_filters(‘berocket_add_out_of_stock_variable’),
   WP_Hook->apply_filters, BeRocket_AAPF_compat_woocommerce_variation::out_of_stock_variable“

Viewing 1 replies (of 1 total)

 *  Plugin Author [Dmytro Holovnia](https://wordpress.org/support/users/dholovnia/)
 * (@dholovnia)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/getting-sql-error/#post-14669443)
 * Hi,
 * Please try to regenerate our tables. Please open plugin settings page tab Addons,
   turn off Additional Tables addon and save setting. Turn it back on and save settings
   again.
 * Regards,
    Dima

Viewing 1 replies (of 1 total)

The topic ‘Getting SQL error’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-ajax-filters/assets/icon-256x256.gif?rev=2770304)
 * [Advanced AJAX Product Filters](https://wordpress.org/plugins/woocommerce-ajax-filters/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-ajax-filters/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-ajax-filters/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-ajax-filters/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-ajax-filters/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-ajax-filters/reviews/)

## Tags

 * [berocket](https://wordpress.org/support/topic-tag/berocket/)

 * 1 reply
 * 2 participants
 * Last reply from: [Dmytro Holovnia](https://wordpress.org/support/users/dholovnia/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/getting-sql-error/#post-14669443)
 * Status: not resolved