SELECT 
  cscart_products.*, 
  cscart_product_descriptions.*, 
  MIN(
    IF(
      cscart_product_prices.percentage_discount = 0, 
      cscart_product_prices.price, 
      cscart_product_prices.price - (
        cscart_product_prices.price * cscart_product_prices.percentage_discount
      )/ 100
    )
  ) as price, 
  GROUP_CONCAT(
    IF(
      cscart_products_categories.link_type = 'M', 
      CONCAT(
        cscart_products_categories.category_id, 
        'M'
      ), 
      cscart_products_categories.category_id
    )
  ) as category_ids, 
  popularity.total as popularity, 
  IF(
    shared_prices.product_id IS NOT NULL, 
    MIN(
      IF(
        shared_prices.percentage_discount = 0, 
        shared_prices.price, 
        shared_prices.price - (
          shared_prices.price * shared_prices.percentage_discount
        )/ 100
      )
    ), 
    MIN(
      IF(
        cscart_product_prices.percentage_discount = 0, 
        cscart_product_prices.price, 
        cscart_product_prices.price - (
          cscart_product_prices.price * cscart_product_prices.percentage_discount
        )/ 100
      )
    )
  ) as price, 
  companies.company as company_name, 
  cscart_product_sales.amount as sales_amount, 
  cscart_seo_names.name as seo_name, 
  cscart_seo_names.path as seo_path, 
  cscart_discussion.type as discussion_type 
FROM 
  cscart_products 
  LEFT JOIN cscart_product_prices ON cscart_product_prices.product_id = cscart_products.product_id 
  AND cscart_product_prices.lower_limit = 1 
  AND cscart_product_prices.usergroup_id IN (0, 0, 1) 
  LEFT JOIN cscart_product_descriptions ON cscart_product_descriptions.product_id = cscart_products.product_id 
  AND cscart_product_descriptions.lang_code = 'en' 
  LEFT JOIN cscart_ult_product_prices shared_prices ON shared_prices.product_id = cscart_products.product_id 
  AND shared_prices.company_id = 1 
  AND shared_prices.lower_limit = 1 
  AND shared_prices.usergroup_id IN (0, 0, 1) 
  LEFT JOIN cscart_companies as companies ON companies.company_id = cscart_products.company_id 
  INNER JOIN cscart_products_categories ON cscart_products_categories.product_id = cscart_products.product_id 
  INNER JOIN cscart_categories ON cscart_categories.category_id = cscart_products_categories.category_id 
  AND cscart_categories.company_id = 1 
  AND (
    cscart_categories.usergroup_ids = '' 
    OR FIND_IN_SET(
      0, cscart_categories.usergroup_ids
    ) 
    OR FIND_IN_SET(
      1, cscart_categories.usergroup_ids
    )
  ) 
  AND (
    cscart_products.usergroup_ids = '' 
    OR FIND_IN_SET(
      0, cscart_products.usergroup_ids
    ) 
    OR FIND_IN_SET(
      1, cscart_products.usergroup_ids
    )
  ) 
  AND cscart_categories.status IN ('A', 'H') 
  AND cscart_products.status IN ('A', 'H') 
  LEFT JOIN cscart_product_popularity as popularity ON popularity.product_id = cscart_products.product_id 
  LEFT JOIN cscart_product_sales ON cscart_product_sales.product_id = cscart_products.product_id 
  AND cscart_product_sales.category_id = 1901 
  LEFT JOIN cscart_seo_names ON cscart_seo_names.object_id = 64277 
  AND cscart_seo_names.type = 'p' 
  AND cscart_seo_names.dispatch = '' 
  AND cscart_seo_names.lang_code = 'en' 
  AND cscart_seo_names.company_id = 1 
  LEFT JOIN cscart_discussion ON cscart_discussion.object_id = cscart_products.product_id 
  AND cscart_discussion.object_type = 'P' 
WHERE 
  cscart_products.product_id = 64277 
  AND (
    companies.status = 'A' 
    OR cscart_products.company_id = 0
  ) 
GROUP BY 
  cscart_products.product_id

Query time 0.00141

JSON explain

{
  "query_block": {
    "select_id": 1,
    "table": {
      "table_name": "shared_prices",
      "access_type": "system",
      "possible_keys": [
        "usergroup",
        "product_id",
        "company_id",
        "lower_limit",
        "usergroup_id"
      ],
      "rows": 0,
      "filtered": 0,
      "const_row_not_found": true
    },
    "table": {
      "table_name": "cscart_products",
      "access_type": "const",
      "possible_keys": ["PRIMARY", "status"],
      "key": "PRIMARY",
      "key_length": "3",
      "used_key_parts": ["product_id"],
      "ref": ["const"],
      "rows": 1,
      "filtered": 100
    },
    "table": {
      "table_name": "companies",
      "access_type": "const",
      "possible_keys": ["PRIMARY"],
      "key": "PRIMARY",
      "key_length": "4",
      "used_key_parts": ["company_id"],
      "ref": ["const"],
      "rows": 1,
      "filtered": 100
    },
    "table": {
      "table_name": "popularity",
      "access_type": "const",
      "possible_keys": ["PRIMARY", "total"],
      "key": "PRIMARY",
      "key_length": "3",
      "used_key_parts": ["product_id"],
      "ref": ["const"],
      "rows": 1,
      "filtered": 100
    },
    "table": {
      "table_name": "cscart_product_sales",
      "access_type": "const",
      "possible_keys": ["PRIMARY", "pa"],
      "key": "PRIMARY",
      "key_length": "6",
      "used_key_parts": ["category_id", "product_id"],
      "ref": ["const", "const"],
      "rows": 1,
      "filtered": 100
    },
    "table": {
      "table_name": "cscart_product_prices",
      "access_type": "range",
      "possible_keys": ["usergroup", "product_id", "lower_limit", "usergroup_id"],
      "key": "product_id",
      "key_length": "9",
      "used_key_parts": ["product_id", "usergroup_id", "lower_limit"],
      "rowid_filter": {
        "range": {
          "key": "lower_limit",
          "used_key_parts": ["lower_limit", "product_id", "usergroup_id"]
        },
        "rows": 2,
        "selectivity_pct": 0.074128984
      },
      "rows": 2,
      "filtered": 100,
      "attached_condition": "trigcond(1) and trigcond(cscart_product_prices.product_id = 64277 and cscart_product_prices.lower_limit = 1 and cscart_product_prices.usergroup_id in (0,0,1))"
    },
    "table": {
      "table_name": "cscart_product_descriptions",
      "access_type": "const",
      "possible_keys": ["PRIMARY", "product_id"],
      "key": "product_id",
      "key_length": "9",
      "used_key_parts": ["product_id", "lang_code"],
      "ref": ["const", "const"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "trigcond(cscart_product_descriptions.lang_code = 'en')"
    },
    "table": {
      "table_name": "cscart_products_categories",
      "access_type": "ref",
      "possible_keys": ["PRIMARY", "pt"],
      "key": "pt",
      "key_length": "3",
      "used_key_parts": ["product_id"],
      "ref": ["const"],
      "rows": 7,
      "filtered": 100,
      "using_index": true
    },
    "table": {
      "table_name": "cscart_categories",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY", "c_status", "p_category_id"],
      "key": "PRIMARY",
      "key_length": "3",
      "used_key_parts": ["category_id"],
      "ref": ["cscart_migrate.cscart_products_categories.category_id"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "cscart_categories.company_id = 1 and (cscart_categories.usergroup_ids = '' or find_in_set(0,cscart_categories.usergroup_ids) or find_in_set(1,cscart_categories.usergroup_ids)) and cscart_categories.`status` in ('A','H')"
    },
    "table": {
      "table_name": "cscart_seo_names",
      "access_type": "const",
      "possible_keys": ["PRIMARY", "dispatch"],
      "key": "dispatch",
      "key_length": "210",
      "used_key_parts": [
        "dispatch",
        "object_id",
        "type",
        "lang_code",
        "company_id"
      ],
      "ref": ["const", "const", "const", "const", "const"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "trigcond(cscart_seo_names.`type` = 'p' and cscart_seo_names.dispatch = '' and cscart_seo_names.lang_code = 'en')"
    },
    "table": {
      "table_name": "cscart_discussion",
      "access_type": "ref",
      "possible_keys": ["object_id"],
      "key": "object_id",
      "key_length": "6",
      "used_key_parts": ["object_id", "object_type"],
      "ref": ["const", "const"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "trigcond(cscart_discussion.object_type = 'P')"
    }
  }
}

Result

product_id product_code product_type trustmark_origin trustmark_certified trustmark_leadtime trustmark_location trustmark_return owner_id status company_id list_price amount weight length width height shipping_freight low_avail_limit timestamp usergroup_ids is_edp edp_shipping unlimited_download tracking free_shipping zero_price_action is_pbp is_op is_oper is_returnable return_period avail_since out_of_stock_actions localization min_qty max_qty qty_step list_qty_count tax_ids age_verification age_limit options_type exceptions_type details_layout shipping_params updated_timestamp pricing_note use_new_layout category_image tax_code upc_code product_detail_ids nav_sku sku_columns nav_review_user_id hide_price vendor_fulfilled hide_commercial_price non_returnable ble_basics commercial_hidden allow_configurator enable_customize enable_buy_american base_cost redline_p lang_code product shortname short_description full_description meta_keywords meta_description search_words page_title age_warning_message internal promo_text price category_ids popularity company_name sales_amount seo_name seo_path discussion_type
64277 BLE-L-WL007 P E C M D A 0 A 1 360.00 1000 0.000 0 0 0 0.00 0 1492488000 0 N N N D N R N N N Y 10 0 N 0 0 0 0 13 N 0 P F default a:5:{s:16:"min_items_in_box";i:0;s:16:"max_items_in_box";i:0;s:10:"box_length";i:0;s:9:"box_width";i:0;s:10:"box_height";i:0;} 1747932608 Price increased by $54 - DC 5/14/21 37% commercial discount to base price manually added - DC 5/14/21 Price increased 5% from $335 to $352 - DC 5/25/21 Price increased 10% from $352 to $388 - DC 5/24/22 Price decreased from $388 to $360 - DC 11/18/22 Y none none 856 BLE-L-WL007 {"22952":1,"22951":2,"22950":4} 1051256 0 0 0 0 0 0 0 0 1 0.00 0 en Fluted Shade Swing Arm Wall Sconce <p>A unique decorative flourish in any setting, this swing arm sconce can quickly revamp existing décors or become the highlight of remodeling projects. The fixture’s fluted shade sets a playful tone for the design while its plug-in cord is wrapped around a metal arm, completing a casual modern aesthetic. To reinforce this elevated style with a practical purpose, the adjustable metal arm pivots horizontally to deliver illumination wherever it’s needed.</p> <p>The fixture’s whimsical shade is available with an eclectic selection of finishes, allowing truly unique looks. Choose the perfect options for your space and reinvigorate any room with stylish plug-in wall lighting!</p> <p>|break|</p> <ul> <li>Manufactured in the U.S.A. </li> <li><span>Made-to-order, learn more about the process </span><a href="https://www.barnlight.com/behind-the-scenes-video-footage" target="_blank">here</a>.</li> <li>Read more about our Fluted Shade Swing Arm Sconce over on our <a href="https://www.barnlight.com/inspiration/easy-to-customize-swing-arm-wall-sconces-bring-functional-durable-lighting-to-playroom/" target="_blank">blog</a>!</li> </ul> A whimsical fluted shade and an exposed plug-in create a practical and stylish wall sconce! Fully customizable and made in the USA! BLE-L-WL007, The Fluted Shade Swing Arm Sconce, The Fluted Shade Swing Arm Sconces, The Fluted Shade Swing Arm Wall Sconce, The Fluted Shade Swing Arm Wall Sconces, The Fluted Shade Swing Arm Sconce Light, The Fluted Shade Swing Arm Sconce Lights, The Fluted Shade Swing Arm Sconce Lighting, The Fluted Shade Swing Arm Wall Light, The Fluted Shade Swing Arm Wall Lights, The Fluted Shade Swing Arm Wall Lighting, Fluted Shade Swing Arm Sconce, Fluted Shade Swing Arm Sconces, Fluted Shade Swing Arm Wall Sconce, Fluted Shade Swing Arm Wall Sconces, Fluted Shade Swing Arm Sconce Light, Fluted Shade Swing Arm Sconce Lights, Fluted Shade Swing Arm Sconce Lighting, Fluted Shade Swing Arm Wall Light, Fluted Shade Swing Arm Wall Lights, Fluted Shade Swing Arm Wall Lighting, The Fluted Swing Arm Sconce, The Fluted Swing Arm Sconces, The Fluted Swing Arm Wall Sconce, The Fluted Swing Arm Wall Sconces, The Fluted Swing Arm Sconce Light, The Fluted Swing Arm Sconce Lights, The Fluted Swing Arm Sconce Lighting, The Fluted Swing Arm Wall Light, The Fluted Swing Arm Wall Lights, The Fluted Swing Arm Wall Lighting, Fluted Swing Arm Sconce, Fluted Swing Arm Sconces, Fluted Swing Arm Wall Sconce, Fluted Swing Arm Wall Sconces, Fluted Swing Arm Sconce Light, Fluted Swing Arm Sconce Lights, Fluted Swing Arm Sconce Lighting, Fluted Swing Arm Wall Light, Fluted Swing Arm Wall Lights, Fluted Swing Arm Wall Lighting, Swing Arm Sconce, Swing Arm Sconces, Swing Arm Wall Sconce, Swing Arm Wall Sconces, Swing Arm Sconce Light, Swing Arm Sconce Lights, Swing Arm Sconce Lighting, Swing Arm Wall Light, Swing Arm Wall Lights, Swing Arm Wall Lighting, Adjustable Sconce, Adjustable Sconces, Adjustable Wall Sconce, Adjustable Wall Sconces, Adjustable Sconce Light, Adjustable Sconce Lights, Adjustable Sconce Lighting, Adjustable Wall Light, Adjustable Wall Lights, Adjustable Wall Lighting, Plug-in sconce, plug-in sconces, plug-in wall sconce, plug-in wall sconces, plug-in wall light, plug-in wall lights, plug-in wall lighting, plug-in light, plug-in lights, plug-in lighting, plug-in socket, plug-in sockets, Plug in sconce, plug in sconces, plug in wall sconce, plug in wall sconces, plug in wall light, plug in wall lights, plug in wall lighting, plug in light, plug in lights, plug in lighting, plug in socket, plug in sockets, swing arm, swingarm, swingarm sconce, swingarm light, swingarm lights, swing arm light, swing arm lights, flute, fluted, swing at plug in, sconce plug in, sconce plug-in, wall sconce plug in, wall sconce plug-in, plug wall sconce, plug sconce, plug wall sconces, plug sconces, wall lamps with plugs, wall lamp with plugs, wall lamps with plug, wall lamp with plug, White sconce, White sconces, White wall sconce, White wall sconces, Plug ins, Plug-ins, Plug-in, Plug in, plug in wall lamp, plug in wall lamps, plug-in wall lamp, plug-in wall lamps, plug in sconce white, Interior barn light wall sconce, Interior barn light wall sconces, Interior sconce, interior sconces, interior wall sconce, interior wall sconces, Interior sconce light, Interior sconce lights, Interior sconce lighting, Interior wall light, Interior wall lights, Interior wall lighting, Interior light wall sconce, Interior light wall sconces, Interior light, Interior lights, Interior lighting, wall mount indoor light, wall mount indoor lights, wall mount indoor lighting, wall mount interior light, wall mount interior lights, wall mount interior lighting, wall mounted indoor light, wall mounted indoor lights, wall mounted indoor lighting, wall mounted interior light, wall mounted interior lights, wall mounted interior lighting, interior wall mount light, interior wall mount lights, interior wall mount lighting, interior wall mounted light, interior wall mounted lights, interior wall mounted lighting, wall mount interior sconce, wall mount interior sconces, wall mount interior wall sconce, wall mount interior wall sconces, wall mounted interior sconce, wall mounted interior sconces, wall mounted interior wall sconce, wall mounted interior wall sconces, wall mount indoor sconce, wall mount indoor sconces, wall mount indoor wall sconce, wall mount indoor wall sconces, wall mounted indoor sconce, wall mounted indoor sconces, wall mounted indoor wall sconce, wall mounted indoor wall sconces, Indoor barn light wall sconce, Indoor barn light wall sconces, Indoor sconce, Indoor sconces, Indoor wall sconce, Indoor wall sconces, Indoor sconce light, Indoor sconce lights, Indoor sconce lighting, Indoor wall light, Indoor wall lights, Indoor wall lighting, Indoor light wall sconce, Indoor light wall sconces, Indoor light, Indoor lights, Indoor lighting, bedside swing arm lamp, bedside swing arm lamps, bed side swing arm lamp, bed side swing arm lamps, nightstand swing arm lamp, nightstand swing arm lamps, night stand swing arm lamp, night stand swing arm lamps, bedside swing arm light, bedside swing arm lights, bedside swing arm lighting, bedside swing arm light fixture, bedside swing arm light fixtures, bedside swing arm lighting fixture, bedside swing arm lighting fixture, bedside swing arm lighting fixtures, bed side swing arm light, bed side swing arm lights, bed side swing arm lighting, bed side swing arm light fixture, bed side swing arm light fixtures, bed side swing arm lighting fixture, bed side swing arm lighting fixture, bed side swing arm lighting fixtures, night stand swing arm light, night stand swing arm lights, night stand swing arm lighting, night stand swing arm light fixture, night stand swing arm light fixtures, night stand swing arm lighting fixture, night stand swing arm lighting fixtures, bedside swing arm sconce, bedside swing arm sconces, bedside swing arm wall sconce, bedside swing arm wall sconces, bed side swing arm sconce, bed side swing arm sconces, bed side swing arm wall sconce, bed side swing arm wall sconces, nightstand swing arm sconce, nightstand swing arm sconces, nightstand swing arm wall sconce, nightstand swing arm wall sconces, night stand swing arm sconce, night stand swing arm sconces, night stand swing arm wall sconce, night stand swing arm wall sconces, bedside lamp, bedside lamps, bed side lamp, bed side lamps, nightstand lamp, night stand lamp, nightstand lamps, night stand lamps, bedside light, bed side light, bedside lights, bed side lights, bedside lighting, bed side lighting, nightstand light, nightstand lights, nightstand lighting, night stand light, night stand lights, night stand lighting, reading lights, adjustable arm sconce, wall reading lamps, swing sconce, plug in barn light, plug-in barn light, plug-in light, fluted light, fluted lights, swing out light, Fluted Shade Swing Arm Wall Sconce | Barn Light Electric 360.000000 1531,1639,1795,1832,1899,2003,1901M 203833 Barn Light Electric Company 16 fluted-shade-swing-arm-sconce 1887/1896/1901 B