I recently had to find the rows in a database that contained any multibyte characters. My first thought was to leverage the difference between length() and char_length(). The query would be similiar to this:
Select pKey, dataCol
From myTable
Where length(dataCol) != char_length(dataCol)
To my surprise this query didn’t work. After mulling it over in my mind, I tried [...]
Entries Tagged as 'sql'
Finding international characters with MySQL
August 19th, 2009 · Comments Off · MySQL
Format your SQL
February 9th, 2009 · 6 Comments · Programming
The other day I was complaining on twitter about a almost 2000 character wide SQL Insert statement that I had to debug. Enough with the complaining, I’d like to show how I format SQL statments in my code. In the comments area I’d like to see how you format your SQL.
Break up Select, Insert and [...]
Tags:sql·style·tips & tricks