Query to count the rows count of one column in two tables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • harikiranjammul
    New Member
    • Nov 2011
    • 2

    #1

    Query to count the rows count of one column in two tables

    I need a help on SQL query.

    I have two tables RESPONSETIME00 & RESPONSETIME02, I need to count the URL’s such that how many times it was requested. I am attaching two tables & the output which I am looking for. Let me know how to get the attached output from the two tables.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    There's nothing attached.

    Comment

    • harikiranjammul
      New Member
      • Nov 2011
      • 2

      #3
      Table 1 :


      ID1 Node_Name ID4 ID7
      10.150.3.1 SERVER5 [28/Nov/11:23:09:10 /i3-soft/com
      10.150.3.1 SERVER3 [28/Nov/11:23:09:10 /reuest-transfer
      10.150.3.1 SERVER1 [28/Nov/11:23:09:10 /reuest-transfer
      10.150.3.1 SERVER1 [28/Nov/11:23:09:10 /reuest-transfer
      10.150.3.1 SERVER1 [28/Nov/11:22:09:10 /reuest-transfer
      10.150.3.1 SERVER8 [28/Nov/11:23:09:10 /i3-soft/com
      10.150.3.1 SERVER1 [28/Nov/11:23:09:10 /i3-soft/com
      10.150.3.1 SERVER1 [28/Nov/11:15:09:10 /i3-soft/com
      10.150.3.1 SERVER6 [28/Nov/11:17:09:10 /i3-soft/com
      10.150.3.1 SERVER5 [28/Nov/11:23:09:10 /i3-soft/com
      10.150.3.1 SERVER1 [28/Nov/11:23:09:10 /reuest-transfer
      10.150.3.1 SERVER1 [28/Nov/11:17:09:10 /reuest-transfer
      10.150.3.1 SERVER3 [28/Nov/11:23:09:10 /reuest-transfer
      10.150.3.1 SERVER1 [28/Nov/11:17:09:10 /reuest-transfer



      Table 2 :


      ID1 Node_Name ID4 ID7
      10.150.3.1 SERVER1 [28/Nov/11:15:09:10 /i3-soft/com
      10.150.3.1 SERVER3 [28/Nov/11:15:09:10 /reuest-transfer
      10.150.3.1 SERVER1 [28/Nov/11:17:09:10 /reuest-transfer
      10.150.3.1 SERVER1 [28/Nov/11:17:09:10 /reuest-transfer
      10.150.3.1 SERVER1 [28/Nov/11:22:09:10 /reuest-transfer
      10.150.3.1 SERVER4 [28/Nov/11:23:09:10 /i3-soft/com
      10.150.3.1 SERVER1 [28/Nov/11:23:09:10 /i3-soft/com
      10.150.3.1 SERVER1 [28/Nov/11:15:09:10 /i3-soft/com
      10.150.3.1 SERVER6 [28/Nov/11:17:09:10 /i3-soft/com
      10.150.3.1 SERVER1 [28/Nov/11:23:09:10 /i3-soft/com
      10.150.3.1 SERVER1 [28/Nov/11:23:09:10 /i3-soft/com
      10.150.3.1 SERVER1 [28/Nov/11:17:09:10 /i3-soft/com
      10.150.3.1 SERVER3 [28/Nov/11:23:09:10 /i3-soft/com
      10.150.3.1 SERVER1 [28/Nov/11:17:09:10 /i3-soft/com


      output i am looking for


      ID7 Count
      /i3-soft/com 16
      /reuest-transfer 12

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        Union the tables and then do a count grouping the ID7 field.

        Comment

        Working...