select 1与select * 的区别:“selelct 常量 from表名” 对应所有行,返回的永远只有一个值,即常量 ,所以一般只用来判断是否有表记录;而“select * from 表名” 是返回所有行的所有列。性能上的差异,关键看from和where子句。如果where条件中可以通过索引...
分类:
其他好文 时间:
2015-02-15 12:05:10
阅读次数:
192
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
Rotate List
Given a list, rotate the list to the right by k places, where k is non-negative.
For example:
Given 1->2->3->4->5->NULL and k = 2,
return 4->5->1->2->...
分类:
其他好文 时间:
2015-02-15 10:48:19
阅读次数:
166
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 "adjacent" cells are those horizontally or vertically nei...
分类:
其他好文 时间:
2015-02-15 09:24:56
阅读次数:
191
一、只要设计到where查询语句,无论是增删改查$cn['username'] = session('member.username');$cn['itemid'] = $itemid;$item = M('Buy')->where($cn)->find();或者$cn = array(sessi....
分类:
Web程序 时间:
2015-02-14 23:45:05
阅读次数:
339
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.[Solution] 1 TreeNode *sortedArrayToBST(vector &num) ...
分类:
其他好文 时间:
2015-02-14 22:27:21
阅读次数:
220
用传参方式模糊查询searchName 按常规的思路,我们会这样写 ,代码如下:String searchName ="Sam"; String strSql = "select * FROM Table1 where Name like '%@Name%' "; SqlParameter[] p....
分类:
数据库 时间:
2015-02-14 17:31:19
阅读次数:
185
where($map)->find(); if($user){ if($user['state']==1){ session($client_ip...
分类:
其他好文 时间:
2015-02-14 16:08:06
阅读次数:
119
1、选取最适用的字段属性,尽可能减少定义字段长度,尽量把字段设置NOT NULL,例如'省份,性别',最好设置为ENUM2、使用连接(JOIN)来代替子查询: a.删除没有任何订单客户:DELETE FROM customerinfo WHERE customerid NOT in(SELECT c...
分类:
数据库 时间:
2015-02-14 16:06:10
阅读次数:
162
mysql -u root -pmysql>use mysql;mysql>select 'host' from user where user='root';mysql>update user set host = '%' where user ='root';mysql>flush privil...
分类:
数据库 时间:
2015-02-14 16:04:27
阅读次数:
184
sql where 1=1和 0=1 的作用原文地址:http://www.cnblogs.com/junyuz/archive/2011/03/10/1979646.htmlwhere 1=1; 这个条件始终为True,在不定数量查询条件情况下,1=1可以很方便的规范语句。一、不用where1=1...
分类:
数据库 时间:
2015-02-14 15:00:14
阅读次数:
158