SQL:

Any useful bits and pieces of SQL code will be kept in this folder.

Counting Strings or Characters

This will count the number of a particular string or character in the fields of a particular column. It's a bit long winded but I couldn't find any prebuilt function to do this kind of thing:

SELECT (LENGTH(column)-LENGTH(REPLACE(column, 'string', ''))) 
FROM table;