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.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.mdown
get_age_from_date.sql
get_age_from_social_security_number.sql
get_date_from_social_security_number.sql

README.mdown

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;