Open main menu

CDOT Wiki β

Changes

User:Minooz/NexJ/database

14 bytes added, 11:15, 15 November 2010
PostgreSQL and MySQL
:: Because MySQL uses C escape syntax in strings (for example, “\n” to represent a newline character), you must double any “\” that you use in LIKE strings. For example, to search for “\n”, specify it as “\\n”. To search for “\”, specify it as “\\\\”; this is because the backslashes are stripped once by the parser and again when the pattern match is made, leaving a single backslash to be matched against.
::Exception: At the end of the pattern string, backslash can be specified as “\\”. At the end of the string, backslash stands for itself because there is nothing following to escape. Suppose that a table contains the following values:
<code>
mysql> SELECT filename FROM t1;
+--------------+
| C:\Programs\ | 1 |
+--------------+-----------------------+
</code>
*The current versions are MySQL 5.1 and PostgreSQL 8.4.
#PostgreSQL is a unified database server with a single storage engine. MySQL has two layers, an upper SQL layer and a set of storage engines. [http://www.wikivs.com/wiki/MySQL_vs_PostgreSQL]
1
edit