SELECT `id`,`gs_schoolnamecn` FROM `tsh_greenschool` WHERE ( state=1 and gs_cityid=1 ) ORDER BY convert(gs_schoolnamecn USING gbk)
分类:
数据库 时间:
2015-05-06 17:17:24
阅读次数:
166
MYSQL查询通过date类型的字段查询一段时间记录2010-04-29 16:22:34| 分类: 默认分类 |举报|字号 订阅 下载LOFTER客户端select * from wap_content where week(created_at) = week(now)如果你要严格要求是某一年....
分类:
数据库 时间:
2015-05-06 16:49:21
阅读次数:
130
1 --检查日志文件不能被截断的原因 2 SELECT * FROM sys.databases WHERE database_id=9 3 --SELECT * FROM sys.sysdatabases 4 --查看日志占用日志文件占用率 5 DBCC SQLPERF(LOGSPACE) 6 G...
分类:
其他好文 时间:
2015-05-06 14:36:14
阅读次数:
120
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.
题意:给一个有序的链表建立二叉搜索树。
思路:这里是先递归建立左子树,然后链表跟着移动,左子树建立完了,此时节点就到了根了,接着建立右子树。
/**
* Definit...
分类:
其他好文 时间:
2015-05-06 13:19:54
阅读次数:
85
select (@rowNO := @rowNo+1) AS rowno,field1,field2,field3 from (select field1,field2,field3 from table_name where field3 = '2012-04-21') a,(select @rowNO :=0) b...
分类:
数据库 时间:
2015-05-06 11:05:20
阅读次数:
189
【题目】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 "ad...
分类:
其他好文 时间:
2015-05-06 10:40:43
阅读次数:
159
A用户登录查询A的表SELECT*FROMUSER_TABLES;A用户登录查询B的表select * from all_tables where owner='SCOTT';其中用户名SCOTT大写。
分类:
数据库 时间:
2015-05-06 10:37:43
阅读次数:
161
建立索引常用的规则如下:1、表的主键、外键必须有索引;2、数据量超过300的表应该有索引;3、经常与其他表进行连接的表,在连接字段上应该建立索引;4、经常出现在Where子句中的字段,特别是大表的字段,应该建立索引;5、索引应该建在选择性高的字段上;6、索引应该建在小字段上,对于大的文本字段甚至超长...
分类:
数据库 时间:
2015-05-05 23:19:41
阅读次数:
162
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
题意:将一个有序数组变成二叉搜索树。
思路:简单的递归。
/**
* Definition for a binary tree node.
* public class TreeNode {...
分类:
其他好文 时间:
2015-05-05 21:59:06
阅读次数:
117
Bitwise AND of Numbers RangeGiven a range [m, n] where 0 >= 1) lena++; while(b >>= 1) lenb++; if(lena == lenb) { for(int i = m...
分类:
其他好文 时间:
2015-05-05 21:28:06
阅读次数:
110