06 2018 档案

摘要:在Oracle中,要按特定条件查询前N条记录,用个rownum就搞定了。 select * from emp where rownum <= 5 而且书上也告诫,不能对rownum用">",这也就意味着,如果你想用 select * from emp where rownum > 5 则是失败的。要 阅读全文
posted @ 2018-06-23 22:56 孜然风味 阅读(123) 评论(0) 推荐(0)
摘要:class Solution {public: int reverse(int x) { int rev = 0; while (x != 0) { int pop = x % 10; x /= 10; if (rev > INT_MAX/10 || (rev == INT_MAX / 10 && 阅读全文
posted @ 2018-06-23 22:25 孜然风味 阅读(213) 评论(0) 推荐(0)
摘要:int turn(int a) { a = ~a + 1; return a; } 阅读全文
posted @ 2018-06-23 22:16 孜然风味 阅读(235) 评论(0) 推荐(0)
摘要:一般的做法(我自己也这样做了哈哈) public int[] twoSum(int[] nums, int target) { for (int i = 0; i < nums.length; i++) { for (int j = i + 1; j < nums.length; j++) { if 阅读全文
posted @ 2018-06-23 21:50 孜然风味 阅读(2248) 评论(0) 推荐(0)
摘要:经常用到在数据库中查询中间几条数据的需求 比如下面的sql语句: ① selete * from testtable limit 2,1; ② selete * from testtable limit 2 offset 1; 注意: 1.数据库数据计算是从0开始的 2.offset X是跳过X个数 阅读全文
posted @ 2018-06-07 19:58 孜然风味 阅读(11445) 评论(0) 推荐(1)