mysql - Need to calculate the age of horses -
in sql, need calculate age of horses have died, multiply 3 human age.
there column called 'born' , column called 'passed', containing year died.
so need calculate age of horses born column (year born) passed column (year passed away) there age, multiply number three. need list horse_id, name, , age in human years, know how select statement myself.
try code,
select horse_id, name, ((passed-born) * 3) humanage horses passed not null;
Comments
Post a Comment