/*create table teacher( tno varchar(10) primary key,-- 教师编号 tname varchar(20) not null,-- 教师姓名 sex char(2) default '男',-- 性别 age date,-- 年龄 sal int,--... ...
分类:
数据库 时间:
2017-02-26 01:09:31
阅读次数:
270
计算周岁的SQL语句:select trunc(months_between(sysdate,date'1992-12-8')/12) 年龄 from dual;用到两个函数:trunc和months_betweentrunc函数两种用法:1、trunc(number1,number2),只舍不入取...
分类:
数据库 时间:
2015-10-02 13:45:47
阅读次数:
321
根据出生日期计算年龄
public class DateGetAge
{
public static int getAge(Date birthDay) throws Exception
{
Calendar cal = Calendar.getInstance();
if (cal.before(birthDay))
{
...
分类:
其他好文 时间:
2015-06-10 19:33:41
阅读次数:
191