selectmax(terms.term_id) as term_id, max(terms.name) as name, max(terms.slug) as slug, max(terms.parent) as parent, max(terms.order_by) as order_by,
max(terms.bottom_detail) as bottom_detail, max(terms.logo) as logo, max(terms.banner) as banner, max(terms.description) as description,
max(terms.seo_image) as seo_image, max(terms.seo_description) as seo_description, max(terms.seo_title) as seo_title, max(terms.seo_index) as seo_index, COUNT(distinct(products.id)) as products_count from `terms` leftjoin `ec_products` as `products` on `products`.`category_id` = `terms`.`term_id` and (`products`.`is_visible` =1and `products`.`status` ='Online') where `terms`.`status` ='published'and `terms`.`slug` ='air-valves'groupby `terms`.`term_id` orderby `terms`.`order_by` asc
selectmax(materialized_products.id) as id,
max(price) as price,
max(brandname) as brandname,
max(brands_id) as brands_id,
max(rating) as rating,
max(cat_name) as cat_name,
max(cat_logo) as cat_logo,
max(cat_slug) as cat_slug from `materialized_products` leftjoin `filter_data` on `filter_data`.`product_id` = `materialized_products`.`id` where `category_id` in (814) groupby `materialized_products`.`id`
selectcount(*) as aggregate from (select materialized_products.id,
max(materialized_products.name) as name,
max(sku) as sku,
max(materialized_products.price) as price,
max(sale_price) as sale_price,
max(image_url) as image_url,
max(is_recommended) as is_recommended,
max(materialized_products.start_date) as start_date,
max(materialized_products.end_date) as end_date,
max(detail) as detail,
max(pro_slug) as pro_slug,
max(brandname) as brandname,
max(brands_id) as brands_id,
max(rating) as rating,
max(authorized) as authorized,
max(discount_percent) as discount_percent,
max(total_vouchers) as total_vouchers,
max(total_variant) as total_variant,
CASEWHEN bundle_start <= NOW() AND (bundle_end >= NOW() OR bundle_end ISNULL) THEN1ELSE0ENDAS seller_bundles_tag,
CASEWHEN free_ship_period =1AND free_ship_start <= NOW() AND (free_ship_end >= NOW() OR free_ship_end ISNULL) THEN1WHEN free_ship_period =0THEN1ELSE0ENDAS free_shippings_tag from `materialized_products` where0=1groupby `id`) as `aggregate_table`
select GROUP_CONCAT(DISTINCT(filter_data.value) ORDERBYCAST(filter_data.value ASDECIMAL(10, 2))) as all_values,max(filter_data.id) as id,max(filter_data.name) as name,max(filter_data.field_id) as field_id,max(filter_data.term_id) as term_id from `filter_data` leftjoin `form_fields` on `filter_data`.`field_id` = `form_fields`.`field_id` where0=1and `filter_data`.`term_id` =814groupby `filter_data`.`field_id` orderby `order` asc
select terms.term_id, max(terms.name) as name, max(terms.slug) as slug, max(terms.parent) as parent, max(terms.order_by) as order_by, max(terms.bottom_detail) as bottom_detail, max(terms.logo) as logo, max(terms.banner) as banner, COUNT(distinct(products.id)) as products_count from `target_cat` innerjoin `terms` on `target_cat`.`target` = `terms`.`term_id` leftjoin `ec_products` as `products` on `products`.`category_id` = `terms`.`term_id` and (`products`.`is_visible` =1and `products`.`status` ='Online') where `target_cat`.`term_id` =814and `terms`.`status` ='published'groupby `terms`.`term_id` orderby `order_by` asc