Reputation: 2363
How databases count newlines (carriage return CR, line feed LF). For example with a column type varchar(10):
abcdef
gh
Will be count as 9 or 10?
Edit: I tested with PostgresSQL and it gives 9, is it the same for the others?
Upvotes: 0
Views: 535
Reputation: 15389
The result is 9:
I've tried your query on Sql Fiddle with MySql 5.5.32 version, Postgres 9.3.1, Sql Server 2012.
Sql Server 2012 Sql Fiddle Trial
Upvotes: 1
Reputation: 24002
Please try below snippet
mysql> select length('abcdef
'> gh');
+---------------------+
| length('abcdef
gh') |
+---------------------+
| 9 |
+---------------------+
1 row in set (0.00 sec)
Upvotes: 0