Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2004
    Posts
    17

    Unanswered: SQL Query....its urgent plz

    Hi All,


    Got Struck With An Problem, Its Very Urgent For Me. Experts Please Help.

    I Have An Table Like Below.

    Table1 :

    Ip - Service - Hit

    1.1.1.1 - Udp - 200
    1.1.1.1 - Tcp - 300
    1.1.1.1 - Udp - 200
    2.2.2.2 - Udp - 100
    2.2.2.2 - Tcp - 50
    2.2.2.2 - Tcp - 100


    Table1 Cotains Some Type Of Log Data, Which I Have To Copy To Table2.

    Table2 Looks Like Below.i Am Trying For A (1 Or 2 Queries) Query Which Should Copy Data From Table1 To Table2
    Like Below.


    Table2 :

    Ip - Service - Hit - Rank1 - Rank2

    1.1.1.1 - Udp - 400 - 1 - 1
    1.1.1.1 - Tcp - 300 - 1 - 2
    2.2.2.2 - Udp - 100 - 2 - 2
    2.2.2.2 - Tcp - 150 - 1 - 1

    Ip : From Table1 To Table2 Should Be Copied Like....group By Service Where Ip = Ip
    Service : Will Be Copied Group By Service
    Hit : Sum Of Hit Group By Service Where Ip = Ip
    Rank1 : Group By Ip And Sum Of Hit, Max Hit Ip Would Be Top Rank.
    Rank2 : Group By Ip,service And Sum Of Hit, Max Hit Service Will Be Top Rank Where Ip = Ip.

    Thanks In Advance.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    please explain how this problem is different from this one --
    http://www.dbforums.com/showthread.php?t=1063783
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Nov 2004
    Posts
    17

    sorry I didnt find your reply before..

    sorry I didnt saw your reply..thot to explain problem clearly, so again i sent same question with explanation....

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •