There are three separate approaches to pattern matching provided by?PostgreSQL: the traditional?SQL?LIKE?operator, the more recent?SIMILAR TO?operator (added in SQL:1999), and?POSIX-style r...
分类:
数据库 时间:
2014-09-01 12:44:23
阅读次数:
380
模糊查询是很常见很实用的查询技巧,对于初学者需要掌握一般模糊查询语句如下:SELECT 字段 FROM 表 WHERE 某字段 Like 条件其中关于条件,SQL提供了四种匹配模式:1,%:表示任意0个或多个字符。可匹配任意类型和长度的字符,有些情况下若是中文,请使用两个百分号(%%)表示。比如 S...
分类:
数据库 时间:
2014-09-01 12:23:33
阅读次数:
233
/** * sql模糊查询特殊字符(\,%和_)处理 * * @param string $str * @return string */ public static function like_search_specialchars($str){ return str_rep...
分类:
数据库 时间:
2014-09-01 10:41:23
阅读次数:
261
使用MySQL命令行可以实现许多我们需要的功能,不过在使用MySQL命令行的时候,有一个问题是在MySQL命令行插入中文数据或者查询中文数据时出现乱码,或者显示不对。1、在MySQL命令行输入:show variables like 'character_set_%'; 查看当前配置的编码。2、在....
分类:
数据库 时间:
2014-08-31 17:14:01
阅读次数:
198
数据迁移一, 使用.dump命令命令帮助提示.dump ?TABLE? ... Dump the database in an SQL text format If TABLE specified, only dump tables matching LIKE pattern TABLE.理解...
分类:
数据库 时间:
2014-08-30 16:26:59
阅读次数:
271
declare @name varchar(200)while(exists(select * from sysobjects where name like '表名前缀%'))beginselect @name=name from sysobjects where name like '表名前缀%...
分类:
数据库 时间:
2014-08-30 13:46:59
阅读次数:
221
转自:http://www.dotblogs.com.tw/rachen/archive/2008/10/07/5611.aspx函數一.產生 Like 比對用字串create function fn_get_fuzzy_str( @instr nvarchar(256) )returns nvar...
分类:
数据库 时间:
2014-08-29 12:57:07
阅读次数:
312
Nginx(發音同engine x)是一款由俄羅斯程式設計師Igor Sysoev所開發輕量級的網頁伺服器、反向代理伺服器以及電子信件(IMAP/POP3)代理伺服器。起初是供俄國大型的入口網站及搜尋引擎Rambler(俄語:Рамблер)使用。此軟體BSD-like協定下發行,可以在UNIX、G...
分类:
其他好文 时间:
2014-08-29 12:41:57
阅读次数:
188
1, 对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引
2,应尽量避免在 where 子句中对字段进行 null 值判断,创建表时NULL是默认值,但大多数时候应该使用NOT NULL,或者使用一个特殊的值,如0,-1作为默 认值。
3,应尽量避免在 where 子句中使用!=或,>=,BETWEEN,IN,以及某些时候的LIKE。
...
分类:
数据库 时间:
2014-08-29 07:17:47
阅读次数:
308
Description
Alice and Bob are very smart guys and they like to play all kinds of games in their spare time. the most amazing thing is that they always find the best strategy, and that's why they fe...
分类:
其他好文 时间:
2014-08-28 16:55:48
阅读次数:
303