orestiss
orestiss

Reputation: 2293

How to execute datediff on multiple rows

I want to do something like this:

select datediff('2010-01-21',(select date_of_birth from people));

and take as result the difference from each date_of_birth.

Upvotes: 1

Views: 230

Answers (1)

HaveNoDisplayName
HaveNoDisplayName

Reputation: 8517

You can use datediff to get Difference in terms of day or specified format (either month, week year, days etc)

select datediff(DAY,'2010-01-21',date_of_birth)
from people

Upvotes: 4

Related Questions