SQL

SQL

Saturday, January 19, 2013

SQL for the new user

I remember when I first started using SQL Server, I was just starting in finance and we had just begun making the change from Access databases. The hardest part about using SQL when you first start is how to put what you want to do into the correct SQL syntax. In my current department I am surrounded with novice users that need to use SQL to query our many databases. They run across many obstacles, the biggest is translating the request to SQL language.
Aggregating Data – if you used Access you remember the group by button, this is no different.
SELECT Distinct X,COUNT(X)as VOLUME
FROM Your Table
Group By X

The aggregated column will be named volume. We could have also used Sum. Get to know these aggregating techniques, because they can save you time in the long run. This way you will not have to copy/paste the data from SQL to excel and then create a pivot table for your aggregation.  (which I know you do)


No comments:

Post a Comment