Skip to content

Instantly share code, notes, and snippets.

@shishircse06
Created September 17, 2015 06:37
Show Gist options
  • Save shishircse06/02db9f9262449c6169f4 to your computer and use it in GitHub Desktop.
Save shishircse06/02db9f9262449c6169f4 to your computer and use it in GitHub Desktop.
find age from date and then query users
SELECT first_name from users where created_at >
(
select TIMESTAMPDIFF(YEAR, created_at, CURDATE())
AS age from users where id=1
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment