两个日期之间的年龄

时间:2017-08-14 07:36:35

标签: sql oracle

我需要让所有在我指定的两个日期之间年龄为64岁的员工。任何帮助将不胜感激。

我试过的是:

SELECT 
    papf.person_id, 
    date_of_birth, 
    first_name, last_name, 
FROM per_all_people_f papf 
WHERE 
    paaf.person_id = NVL(:P_PERSON_ID, paaf.person_id) 
    AND :START_DATE = TO_DATE(:START_DATE, 'YYYY-MM-DD') 
    AND :END_DATE = TO_DATE(:END_DATE, 'YYYY-MM-DD')

3 个答案:

答案 0 :(得分:1)

试试这个: -

SELECT person_id, date_of_birth, first_name, last_name FROM per_all_people_f 
WHERE floor(months_between(date START_DATE, date END_DATE) /12)=64;

答案 1 :(得分:0)

我试过这个并且有效:

echo "${o##*/} [-h] does something

答案 2 :(得分:-1)

自从Oracle提出查询以来,请尝试以下方法:

private void SlideOut()
{
    LayoutAnimationController controller = 
    AnimationUtils.loadLayoutAnimation(this, R.anim.layout_pop_out);
    Animation animation=controller.getAnimation();
    animation.setFillAfter(true);
    LinearLayout menuLayout =((LinearLayout)findViewById(R.id.menuLayout));
    menuLayout.setLayoutAnimation(controller);
    menuLayout.startLayoutAnimation();
}

@Override
public void onBackPressed(){
    //super.onBackPressed();
    SlideOut();     
}