If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > SQL Query....its urgent plz

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-21-04, 21:04
maven maven is offline
Registered User
 
Join Date: Nov 2004
Posts: 17
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.
Reply With Quote
  #2 (permalink)  
Old 11-21-04, 21:44
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
please explain how this problem is different from this one --
problem with group by
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 11-21-04, 21:51
maven maven is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On