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
JComboBox action commands
If Statement for a Width in a mx:Text
find textbox and start div underneath it
Windows 7 - Windows could not be activated
Resetting a 3600 Cisco Router to Factory Defaults
New ESXi install fails (PSOD)
Joomla Re-install
Perl, Using Text::CSV_XS / Count number of references
SBS 2k3 unable to relay mails
USB Video Card - 32 bit on 64 bit machine?