Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
JacobPressures
Posting Yak Master
112 Posts |
Posted - 2009-04-17 : 17:49:12
|
| What is this structure called? I want to do more research on it to better understand it. It is later joined as one would a table in another query later in the script. Thanks!WITH GuardianAS( SELECT sc.StudentID, scp.LastName, scp.FirstName, ROW_NUMBER() OVER(PARTITION BY sc.StudentID ORDER BY scp.LastName, scp.FirstName) AS rn FROM dbo.StudentContact sc INNER JOIN dbo.Person scp ON scp.PersonID = sc.ContactID WHERE sc.IsCustodian = 1 ) |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2009-04-17 : 17:57:21
|
| That's a CTE or Common Table Expression. |
 |
|
|
JacobPressures
Posting Yak Master
112 Posts |
Posted - 2009-04-17 : 18:08:35
|
| Ok thanks! I'll look that up. |
 |
|
|
|
|
|