Re: subquery problem, wrong reference in the subquery?
From: Tom Moreau (tom_at_dont.spam.me.cips.ca)
Date: 07/09/04
- Next message: Markus Helius: "Re: per SQl Statment SpaltenNamen aendern MsSql 2000"
- Previous message: Adam Machanic: "Re: Boolean Naming Conventions"
- In reply to: MailSurfer: "subquery problem, wrong reference in the subquery?"
- Next in thread: Michael: "Re: subquery problem, wrong reference in the subquery?"
- Reply: Michael: "Re: subquery problem, wrong reference in the subquery?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 9 Jul 2004 14:02:21 -0400
There's nothing wrong with the query. What were you expecting?
-- Tom --------------------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA SQL Server MVP Columnist, SQL Server Professional Toronto, ON Canada www.pinnaclepublishing.com/sql "MailSurfer" <microstone@hotmail.com> wrote in message news:e96a3678.0407090958.5d672e8d@posting.google.com... In the following example, the t2 table doesn't even have that keyID field. The query still runs and give out results. Why? Is this a known bug? /* create table t1 (rowid int primary key, keyid int, rowname varchar(100)) create table t2 (rowid int primary key, rowname varchar(100)) insert into t1 values (1,1,'a') insert into t1 values (2,1,'b') insert into t1 values (3,2,'c') insert into t2 values (1,'d') insert into t2 values (2,'e') select * from t1 where keyid in (select keyid from t2) drop table t1, t2 */ ON Microsoft SQL Server 7.00 - 7.00.961 (Intel X86) Oct 24 2000 18:39:12 Copyright (c) 1988-1998 Microsoft Corporation Enterprise Edition on Windows NT 5.0 (Build 2195: Service Pack 4)
- Next message: Markus Helius: "Re: per SQl Statment SpaltenNamen aendern MsSql 2000"
- Previous message: Adam Machanic: "Re: Boolean Naming Conventions"
- In reply to: MailSurfer: "subquery problem, wrong reference in the subquery?"
- Next in thread: Michael: "Re: subquery problem, wrong reference in the subquery?"
- Reply: Michael: "Re: subquery problem, wrong reference in the subquery?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|