How to display the age of all the employees? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to display the age of all the employees?

Create nd populate the table "Employee(emp_no,dept_no,name,salary,dob,city).

9th Jun 2022, 1:39 PM
Payal Sharma
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) 
9th Jun 2022, 4:20 PM
A͢J
A͢J - avatar
0
What does the table look like? You have to provide a little more information.
9th Jun 2022, 3:26 PM
Justice
Justice - avatar