Category Archives: Databases
- March 3, 2011
- MySQL alternative to MSSQL’s isNull()
I was looking for a way to do isNull() in MySQL the other day, for those that don’t know this means you can do something like: If the value in mycolumn is NULL, then ‘blah’ is returned, this can of course be any string literal/numeric value you want. MySQL doesn’t have isNull() but it does [...]
- February 8, 2011
- SQL for finding duplicate values
Quick post to remind me how to check a table column for duplicate values next time I’m looking for it (when my memory fails!)
- November 14, 2010
- Importing a csv into MySQL using the command line– also posted in Mac
UPDATE 16th Nov 2010: I had some issues with the import which I noted in the first code example below Today I had to import csv into a single mysql table. The destination table only had 5 columns and the csv was around 22MB (around 400,000 records). The csv also contained more columns that I [...]
- October 4, 2010
- Case sensitive development on Mac OS X– also posted in Mac
At work most of the developers are on Mac OS X but our staging and production environments are Linux based. This means development is case insensitive but stage/production is case sensitive. Although we have development guidelines/standards which dictate file and database naming conventions etc, human error can still occur (in terms of referencing files with [...]
- September 8, 2010
- Tip when adding “allowMultiQueries=true” to your MySQL DSN in ColdFusion– also posted in ColdFusion
Scenario…I’m using ColdFusion 9 and MySQL 5. I already had my DSN setup but had a requirement to get the last inserted id from a MySQL INSERT statement (I’m using auto-incrementing integer’s). As most people know, the best way to do this (in MySQL) is using the last_insert_id() function. I wanted to attach this to [...]
