![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据库
笑容渐渐消失
这个作者很懒,什么都没留下…
展开
-
oracle将查询结果作为参数for循环
oracle将查询结果作为参数for循环,将结果插入到临时表中for in 循环for in 例子 for i in 1 .. 100 loop str := str + i; end loop;sys.dbms_output.put_line(str );将结果存入变量中FOR i IN (select id,name from test)LOOPBEGIN--拼接 动态参数sql V_SQL := ' select * from student where id =' ||原创 2020-09-17 10:44:55 · 4759 阅读 · 0 评论 -
oracle查询时间段内数据
利用 between and (在…之间)首先使用to_char()函数转换类型select name from temp where to_char(sj,'yyyy-mm-dd') between '2020-01-01' and '2020-12-31'即查询2020一整年的数据原创 2020-09-17 09:37:35 · 259 阅读 · 0 评论