A select query with 5 WHEREs

  • Friday fun?

    create table [where] ([where] char(5))

    go

    insert into [where] ([where]) values ('where')

    go

    select [where] from [where] where [where] = 'where'

    go

    drop table [where]

    go

  • Or, if you want to be even more confusing...

    create table [where]

    ([where] char(5),

    [from [where] varchar(25),

    [select [where from [where] varCHAR(50),

    )

    go

    insert into [where] values ('from where', '[from [where]]', 'select [where] from [where]]')

    GO

    select [where], [select [where from [where] from [where] where [from [where] = '[from [where]]' and [where] = 'from where';

    GO

    drop table [where]

    go

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Look, I apologize in advance but,

    Where are you going with this?

    Thanks, Ladies and Gentlemen, I'll be here all week.

  • GilaMonster (1/23/2015)


    Or, if you want to be even more confusing...

    create table [where]

    ([where] char(5),

    [from [where] varchar(25),

    [select [where from [where] varCHAR(50),

    )

    go

    insert into [where] values ('from where', '[from [where]]', 'select [where] from [where]]')

    GO

    select [where], [select [where from [where] from [where] where [from [where] = '[from [where]]' and [where] = 'from where';

    GO

    drop table [where]

    go

    Guess this code has to be where'ified

    😎

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply