question

D wi avatar image
D wi asked

help me with these queries

hello im new with sql, i only know this queries to count age but i have task to show all record with conditon age >20
select*, year(curdate()) - year(dob) as age from user

select
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Jon Crawford avatar image
Jon Crawford answered

Consider that someone born in 2000 is not 20 yet if their birthday occurred in June or later month. Also, that someone born in May is 20 if their birthday was yesterday, but not if it was on the 29th.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.