2020年1月10日

oracle数据库-查询一张表中某个字段按照降序排列的前十条数据

摘要: select * from (select * from ldcode where 1=1 order by code desc) where rownum<11--这样写是对的 select * from ldcode where 1=1 order by code desc rownum<11- 阅读全文

posted @ 2020-01-10 15:46 ~码铃薯~ 阅读(1602) 评论(0) 推荐(0) 编辑

SQL语句-查询特定年份产生的数据

摘要: 注意:year函数的使用 select * from lccont where conttype='1' and salechnl in('02','03','04','05') and year(makedate)='2019' 阅读全文

posted @ 2020-01-10 11:43 ~码铃薯~ 阅读(2454) 评论(0) 推荐(0) 编辑

SQL语句-查询一张表中某个字段存在相同值的数据

摘要: 这是查询有两条或者两条以上的数据 --先分组,在统计 select a.code from ldcode a where 1=1 GROUP BY a.code HAVING COUNT(a.code)> 1 这是查询有3条相同数据的情况 --先分组,在统计 select a.code from l 阅读全文

posted @ 2020-01-10 11:10 ~码铃薯~ 阅读(7071) 评论(0) 推荐(1) 编辑

导航