Skip to content

Instantly share code, notes, and snippets.

@prgTW
Created July 9, 2020 09:56
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 prgTW/5014b634bf18d278c0d38d12840960fb to your computer and use it in GitHub Desktop.
Save prgTW/5014b634bf18d278c0d38d12840960fb to your computer and use it in GitHub Desktop.
SELECT 1
FROM `agreement`
INNER JOIN `product1` ON (
`agreement`.`id`=`product1`.`agreement_id`
AND `product1`.`status` IN ('active', 'expiring')
)
WHERE `agreement`.customer_id = :id
LIMIT 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment