Re: Can someone explain this?
From: Anith Sen (anith_at_bizdatasolutions.com)
Date: 09/16/04
- Next message: HTH: "Error - is not a recognized function name."
- Previous message: Keith Kratochvil: "Re: Assign return value of stored proc to a variable"
- In reply to: Will: "Can someone explain this?"
- Next in thread: Tibor Karaszi: "Re: Can someone explain this?"
- Reply: Tibor Karaszi: "Re: Can someone explain this?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 16 Sep 2004 14:17:42 -0500
In your second case, FromTtwo is used as an alias for the column ToneId. So
essentially your query is equivalent to:
SELECT * FROM Tone WHERE ToneId IN ( SELECT ToneId )
which due to lack of scoped aliasing, SQL Server identifies as :
SELECT * FROM Tone
WHERE Tone.ToneId IN ( SELECT Tone.ToneId )
which is evaluated as:
SELECT * FROM Tone
WHERE Tone.ToneId = Tone.ToneId ;
-- Anith
- Next message: HTH: "Error - is not a recognized function name."
- Previous message: Keith Kratochvil: "Re: Assign return value of stored proc to a variable"
- In reply to: Will: "Can someone explain this?"
- Next in thread: Tibor Karaszi: "Re: Can someone explain this?"
- Reply: Tibor Karaszi: "Re: Can someone explain this?"
- Messages sorted by: [ date ] [ thread ]