NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
前多少条 ``` where rownum < 101 ``` 根据时间查询 ``` CREATIONTIME <to_date('2020-04-01 00:00:00','yyyy-MM-dd HH24:mi:ss') CREATIONTIME >= trunc(sysdate)-6 ``` 查询oracle 有没有卡住 ``` select * from v$session t1, v$locked_object t2 where t1.sid = t2.SESSION_ID; ``` 杀掉卡住进程 ``` alter system kill session '284,15722';  // 284,15722 是session id ``` 判断数据是否存在 ``` oralce : select 1 from table where a= 1 and rownum = 1 sql server: select 1 from table where a= 1 limit 1 ``` 查询字段重复(ITEMCODE,ROUTECODE 是内容重复的字段) ``` select ITEMCODE,ROUTECODE,count(*) from BAS_ITEM_ROUTE    where ITEMCODE is not null and ROUTECODE is not null group by ITEMCODE,ROUTECODE having count(*) > 1  ; SELECT count(*) from ( select ITEMCODE,ROUTECODE from BAS_ITEM_ROUTE    where ITEMCODE is not null and ROUTECODE is not null group by ITEMCODE,ROUTECODE having count(*) > 1   ); ```