我怎样才能把这两个条件结合起来?SQL oracle如何结合两个条件
select ename, hiredate, next_day(last_day(hiredate)-7,5)
from emp
where to_number(to_char(hiredate, 'DD)) < 15 ORDER BY hiredate ASC;
和
select ename, hiredate, last_day(next_day(last_day(hiredate), 5))
from emp
where to_number(to_char(hiredate, 'DD)) > 15 ORDER BY hiredate ASC;
我灵机一动,这两个存储变量,然后将它们连接起来。 但是,我目前刚刚接触sql oracle,但我不确定如何去做。 也许我可以做些什么?我希望你明白我想要完成的事情。
Define variable1 = next_day(last_day(hiredate)-7,5)
where to_number(to_char(hiredate, 'DD)) < 15
添加一些示例表格数据和预期结果 - 作为格式化文本(即不是图片)。 – jarlh