Share your SQL scripts, tricks, tips, etc

N2ITN2IT Inactive Imported Users Posts: 7,483 ■■■■■■■■■■
I was thinking why not share some SQL you use that others may find beneficial that you may had to hunt for or discover from another person. I like coming to this forum a lot and discussing all sorts of forms of IT, but talking about code is my favorite. Listed below is some code I use quite up bit to create a dynamic date range. Since a lot of time the information I am querying has multiple date ranges and I want the most latest range.
where t.table = (select max((t1.creationdate)) from table as t1 where t1.daterange = t.daterange)

I find this to be extremely helpful and hope you find it helpful as well.
Sign In or Register to comment.