Microsoft
Software
Hardware
Network
Question : explain T-SQL query to me
Can somebody explain this SQL query to me? what is it doing?
DECLARE @CollectionID int
SELECT @CollectionID= C2.CollectionID
FROM Collections C1
INNER JOIN Collections C2 on C1.CollectionID = C2.ParentID
WHERE C1.Title= '09-0274'
--AND C1.CompanyID= 1 and C2.Title LIKE 'Vendor-' + '240635'
AND C1.CompanyID= 1 and C2.Title LIKE '%240634%'
Answer : explain T-SQL query to me
This type of JOIN is called 'Self Join' - Joining a table with itself.
http://msdn.microsoft.com/
en-us/libr
ary/ms1774
90.aspx
In your case, 'ParentID' column is JOINed to 'CollectionID' column of the same table.
Raj
Random Solutions
100% CPU usage in vCenter but not in taskmanager on the Windows NT 4.0 VM that has been converted
E72 - How to make email work without activating data services?
Konica Minolta bizhub c253/exchange 2007. Scan to email from address will not stay changed
Javascript form validation problems
XSLT Element ordering within templates.
RPC through HTTP keeps prompting for pw on Exchange 2010
how do I reorganise a text file in powershell ?
download file with as3
Please suggest a suitable router
Access cascading combo boxes