Articles


How to pivot data by month in SQL and output to a temporary table

How to pivot data by month in SQL and output to a temporary tableThere are some things that aren't easy to do in SQL as you'd like. I don't know why it has to make the seemingly simple things to complete in Excel so annoyingly tricky. Dynamic pivots is one of those things that is overcomplicated, sure there's plenty of tutorials on the t'internet , but what they all seem to lack is instructions of how to write   more »

Tags : SQL pivot


How to convert a text DDMMMYYY date in SQL

How to convert a text DDMMMYYY date in SQLAs much as I love Excel there are some circumstances where it just doesn't cut it - more than a millions rows and computer says no; some rediculouse vlookup and you could be there for hours. So step in SQL, it can do those aforementioned tasks in a matter of seconds. There are a couple of occasions though where SQL is not king, one of these is   more »



The easy way to find and delete duplicates in SQL

The easy way to find and delete duplicates in SQLNext in my series of helpful SQL code is duplicates, I seem to always be having issues with duplicates. This annoys me immensely as all of the issues comes from other peoples data I have to work with. No problem I hear you say, google is awash with ways of how to delete them. Trouble is these are all based on blindly deleting superfluous rows   more »



How to add an auto incrementing ID field in SQL server

So it turns out that SQL is really quick to pick up, once you have the (very) basics down everything you need to do fall intuitively into place as it is all based on the first principals of a select statement. And even if you do get stuck all answers are a very rapid google search. The biggest trouble I have with starting off programming any new   more »

Tags : SQL number code


How to add better comments into SQL server

How to add better comments into SQL serverWhilst I'm firmly in the 'Tried and Test' camp for most things in life and I may only be new to SQL programming but there are just sometimes when I have to buck the mainstream trend and do it my way. One of these occasions is comments in SQL, the widely adopted way would be to use the prescribed double dash -- or the widely adopted across multiple   more »

Tags : SQL comment code


Search Posts

Back to top