+ 2
How to display the age of all the employees?
Create nd populate the table "Employee(emp_no,dept_no,name,salary,dob,city).
2 Answers
+ 2
Payal Sharma
Use DATEDIFF function in SQL
DATEDIFF(datepart, startdate, enddate)Â
datepart means day, year, month, minute
So age should be in year
age = DATEDIFF(year, dob, current_date)Â
0
What does the table look like? You have to provide a little more information.