/SSN-SQL

A bunch of swedish social security number functions for MySQL. Useful when you have a user table with their social security numbers and want to select only those over X years old.

SSN SQL

A couple of sql functions for calculating a user's age based on swedish sequrity number format.

Examples

SELECT get_age_from_social_security_number('790628-0000');

SELECT get_age_from_social_security_number(u.ssn) FROM users u;

SELECT * FROM users u WHERE get_age_from_social_security_number(ssn) >= 18;