Archive

Posts Tagged ‘sql’

Handling Null Values in SQL Server

May 28th, 2010 7 comments

From time to time, we may want to replace NULL values with some desired value when doing an sql select statement. Turns out that SQL Server makes this a simple task – and no IF statements are necessary! To do this, we use SQL Server's ISNULL function. This function takes two parameters. The first parameter is the name of the field that we expect may have a NULL value that we wish to replace. The second parameter represents the replacement value for the NULL value. Read more…

Categories: SQL Server Tags: , ,

Alternative to MySQL’s LIMIT Command

December 20th, 2009 12 comments

I recently ran into the situation where I needed to create a query in MySQL that counted up to n rows from a result set. I scoffed at the challenge and proceeded to go for the one tool I thought could do the job – MySQL's LIMIT command. Unfortunately, the result I got was not what I had expected. Read more…

Categories: MySQL Tags: , , , ,