Results 1 to 3 of 3

Thread: Is this a bug in SQL

  1. #1
    Junior Member
    Join Date
    Nov 2007
    Answers
    2

    Is this a bug in SQL

    I have found something, i don't know if it is a bug or what? please review the sql below. (i found this in running project but to simplify it i have created similar example tables and query)

    create table tbl1 ( id1 int identity(1,1) primary key, data1 int )
    create table tbl2 ( id int identity(1,1) primary key, id1 int, data2 int )

    select * from tbl1 where id1 in (select data1 from tbl2)

    why above sql statement does not gives error?


  2. #2
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: Is this a bug in SQL

    why that should through error ?


  3. #3

    Re: Is this a bug in SQL

    In the select statement you have given in braces had mentioned data1 as column name, but the column name in tbl2 is data2. So the error message would have thrown definitely.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact