+ 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 Réponses
+ 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.