SQL语句如下:SELECT * FROM 表1 LEFT JOIN 表2 ON 表1.id = 表2.id AND 表2.Name != 'ff'WHERE 表1.NAME != 'aa' 步骤1:返回笛卡尔积(SELECT * FROM表1 CROSS JOIN表2) 步骤2:应用ON筛...
分类:
数据库 时间:
2014-07-10 00:04:24
阅读次数:
266
题目链接 Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two ...
分类:
其他好文 时间:
2014-07-07 22:25:30
阅读次数:
359
转自:http://blog.csdn.net/lianbaixue/article/details/10579117简述:Cocoa框架中的NSPredicate用于查询,原理和用法都类似于SQL中的where,作用相当于数据库的过滤取。定义(最常用到的方法):NSPredicate *ca = ...
分类:
移动开发 时间:
2014-07-07 22:07:20
阅读次数:
293
原文:MS SQL Server带有时间的记录怎样查询比如某一张表[A]有一个保存日期包含时间字段[B],如果以这个段[B]作查询条件对数据记录进行查询。也我们得花些心思才能查询到我们想得到的记录。现在我们需要查询这天2014-06-21的所有记录:SELECT * FROM [A] WHERE [...
分类:
数据库 时间:
2014-07-07 21:00:01
阅读次数:
216
Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjace...
分类:
其他好文 时间:
2014-07-07 17:30:29
阅读次数:
160
Problem Description:Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without u...
分类:
其他好文 时间:
2014-07-07 17:00:35
阅读次数:
161
Problem Description:Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.Solution: 递归。 1 public List>...
分类:
其他好文 时间:
2014-07-07 16:59:12
阅读次数:
169
LeetCode上 Gas Station是比较经典的一题,它的魅力在于算法足够优秀的情况下,代码可以简化到非常简洁的程度。原题如下Gas StationThere areNgas stations along a circular route, where the amount of gas at...
分类:
其他好文 时间:
2014-06-30 11:13:40
阅读次数:
244
【题目】
Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.
Return all such possible sentences.
For example, given
s = "catsanddog",
dict = ["cat", "cats", "and", "sand", "dog...
分类:
其他好文 时间:
2014-06-30 00:51:41
阅读次数:
295
【题目】
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.
Follow up:
Can you solve it without using extra space?
【题意】
给定一个单向链表,如果链表有环,则返回环开始的位置。
【思路】
仍然是维护两个指针, p1, p2, p1每次走一步, p2每次走两步
...
分类:
其他好文 时间:
2014-06-29 23:59:21
阅读次数:
354