Link to home
Start Free TrialLog in
Avatar of morinia
moriniaFlag for United States of America

asked on

What is this SQL Code doing?

Can someone tell me what "umc" is referencing, or how it is being populated in this query.  
I have a basic understanding of the #temp for temp tables but I am a bit puzzled with what is going on with "umc".
umc.txt
ASKER CERTIFIED SOLUTION
Avatar of OCDan
OCDan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Paul Jackson
Paul Jackson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of morinia

ASKER

SELECT umc.*
, dense_rank()
       over (partition by umc.member_id
             order by umc.enrollment_date desc
                    , umc.exit_date)
       as nRank

What is the first six lines of the code doing?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of morinia

ASKER

The use of temporary tables and partitions is this regular SQL or Transact-Sql?  Since you are able to access temproary tables as well as the tables on the server what differentiates this code from regular  MSSql code?
Yes they get used quite a lot in TSQL soryr mate not sure what you mean by regular SQL.

This is valid MSSQL(TSQL) code, copying it into Sql Server Management Studio and performing a syntax check runs fine, so it is likely valid.