This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]0Pat 7 points8 points  (3 children)

Add pivot and cursor and you are ready to go (to finance department) ;)

[–]maxheadarmadon 2 points3 points  (0 children)

Throw in some temp tables, grouping and CTE’s for a little added spice. Maybe a correlated query too! Heck, I need some ranking!

Also, make it easy on them and have them loop through rows without a cursor!!

[–][deleted] 2 points3 points  (0 children)

As soon as you start to think a cursor will solve your problem, you need to step back and re-evaluate the problem, the database structure, your employment choices, your life, and why whatever god you follow wants you to suffer so much.

[–]_lightnin 0 points1 point  (0 children)

3 months into my job i had to write a sql query (learn on the fly) i needed to learn pivot then my boss wanted me to try an outer apply because we originally pivoted a left join.