Advertisement
Guest User

Jarek - SQL

a guest
Nov 22nd, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.69 KB | None | 0 0
  1. SELECT value
  2. FROM catalog_product_entity_varchar
  3. WHERE entity_id=(
  4.     SELECT cpet.entity_id
  5.     FROM catalog_product_entity_text cpet
  6.     WHERE cpet.attribute_id=(
  7.         SELECT attribute_id
  8.         FROM eav_attribute
  9.         WHERE attribute_code="normalized_sku"
  10.         AND entity_type_id=(
  11.             SELECT entity_type_id
  12.             FROM eav_entity_type
  13.             WHERE entity_type_code="catalog_product"
  14.             LIMIT 1
  15.         )
  16.         LIMIT 1
  17.     )
  18.     AND cpet.value LIKE "31%"
  19.     LIMIT 1
  20. )
  21. AND attribute_id=(
  22.     SELECT attribute_id
  23.     FROM eav_attribute
  24.     WHERE attribute_code="url_key"
  25.     AND entity_type_id=(
  26.         SELECT entity_type_id
  27.         FROM eav_entity_type
  28.         WHERE entity_type_code="catalog_product"
  29.         LIMIT 1
  30.     )
  31.     LIMIT 1
  32. )
  33. LIMIT 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement