Answers for "find average age in sql"

SQL
0

calculate age in sql

#THIS IS FOR POSTGRES
# You can use the AGE function. The AGE function requires two arguementS.
# AGE(late date, early date). The NOW() function returns the current timestamp.

AGE(NOW(), date_of_birth) AS age

#Since NOW() is a timestamp, the result will be like this:
# 45 years 2 months 15 days 21:43:05.378372
#You can then use this to extract the age.

LEFT(age, STRPOS(age,' '))
Posted by: Guest on August-09-2021
0

how to find average in sql

SELECT FIRST_NAME FROM EMPLOYEES
WHERE SALARY = (SELECT AVG(SALARY) FROM EMPLOYEES);
Posted by: Guest on November-27-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language