Skip to content

Instantly share code, notes, and snippets.

@Huholoman
Created May 23, 2017 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Huholoman/3af41028d9bc78da76d49e8dd5136987 to your computer and use it in GitHub Desktop.
Save Huholoman/3af41028d9bc78da76d49e8dd5136987 to your computer and use it in GitHub Desktop.
SELECT *
FROM e21
INNER JOIN (
SELECT GROUP_CONCAT(discount_amount) AS discount_amount,
GROUP_CONCAT(discount_type) AS discount_type,
discount_business_id,
discount_subcategory_id,
discount_evidence_number
FROM e21sle GROUP BY discount_business_id
) MAXD ON (business_id=MAXD.discount_business_id)
WHERE ((discount_type LIKE '%VIP%' OR discount_type LIKE '%STD%') AND business_eshop<>1 AND business_region_id='C10' AND business_category_id='A' AND business_subcategory_id='0555' AND business_region_id LIKE 'C%')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment