You can use TIMESTAMPDIFF(unit, datetime_expr1, datetime_expr2)
function:
SELECT TIMESTAMPDIFF(YEAR, '1970-02-01', CURDATE()) AS age
More Related Contents:
- get first occurrence of last changed value of a column [closed]
- MySQL – Rows to Columns
- ROW_NUMBER() in MySQL
- multiple query same table but in different columns mysql
- How can I make SQL case sensitive string comparison on MySQL?
- 1052: Column ‘id’ in field list is ambiguous
- How can I temporarily disable a foreign key constraint in MySQL?
- How to do a batch insert in MySQL
- Count the occurrences of DISTINCT values
- Search for “whole word match” in MySQL
- sql joins as venn diagram
- How can I join multiple SQL tables using the IDs?
- MySQL, better to insert NULL or empty string?
- SQL: selecting rows where column value changed from previous row
- Why do results from a SQL query not come back in the order I expect?
- How to generate data in MySQL?
- MySQL combine two columns and add into a new column
- SQL query of multiple values in one cell
- How to skip certain database tables with mysqldump?
- MySQL error 1241: Operand should contain 1 column(s)
- How to set a MySQL row to READ-ONLY?
- How to transpose rows to columns with large amount of the data in BigQuery/SQL?
- Mysql: Order by like?
- Getting first day of the week in MySql using Week No
- How to format number with “.” as thousands separator and “,” as decimal separator?
- Using DISTINCT and COUNT together in a MySQL Query
- INSERT INTO Table from multiple tables
- Execute INSERT if table is empty?
- Mysql How do you create a clustered index?
- How do I extract Month and Year in a MySQL date and compare them?