intersting sql puzzle

  • Post some more information !!


    Kindest Regards,
    Jaiprakash M Bankolli
    My Blog
    Suggestions for me

  • Y dont u make this into a sci-fi hollywood movie and the money it generates can be used to out source this kinda problems and solve it. 😛

  • neat.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • does not seem to hard, start with create database create table and so on. hehe

    good luck

  • Ok... here it is...

    DECLARE @SpName varchar(10)

    SET @SpName = 'Y'

    SELECT DISTINCT ANTI_MISSILE.antim_id,ANTI_MISSILE.anitm_name FROM DEFUSE_CAPABILITY

    INNER JOIN ANTI_MISSILE ON DEFUSE_CAPABILITY.antim_id = ANTI_MISSILE.antim_id

    WHERE DEFUSE_CAPABILITY.antim_id IN

    (

    SELECT antim_id FROM

    (

    SELECT Count(*) AS xcnt ,antim_id FROM DEFUSE_CAPABILITY

    WHERE missile_id IN (SELECT missile_id FROM ALIEN_CAPABILITY INNER JOIN SPECIES ON SPECIES.spcid = ALIEN_CAPABILITY.spcid WHERE SPECIES.spcname = @SPname)

    Group BY antim_id

    ) C1

    WHERE xcnt >= (SELECT Count(*) FROM ALIEN_CAPABILITY INNER JOIN SPECIES ON SPECIES.spcid = ALIEN_CAPABILITY.spcid WHERE SPECIES.spcname = @SPname)

    )

    Atif Sheikh

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

Viewing 5 posts - 16 through 19 (of 19 total)

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