WLSE adjust beacon count for rogue detection

Hi all,
Does anyone know if there is any way to adjust how many beacons it takes for a device to be displayed as a rogue in device faults? I've been all over the settings area and cannot find anything regarding it.
WLSE is version 2.9
Here's what's happening:
campus of about 300 1210G AP's
friendly's are showing up as rogues after seeing a single packet. This is typically a malformed packet, meaning it is incomplete ie. the ssid is incomplete
ALL friendly's are managed by WLSE and are in the database.
What I would like to do is have it require seeing 2-5 beacons before it is tagged as a rougue and entered into the faults table.
Thanks,
Brian

Hi,
I recommend that you do not load 12.3.(2)ja code, there are several bugs associated with this code. One being trouble acquiring a DHCP address and the other is AP will reboot whenever they feel like it. The DHCP problem I have not experienced, but there is a bug listed with TAC and several people on the discussion pages have had this problem. I have just started to see my AP's reboot that have this code and there are several others on the discussion page that are saying they are having the problem with 1100 ap's. I have over three hundred ap's (1200,1100,350), most running 12.2.(15)ja without any problems other than the WLSE rogue issue.

Similar Messages

  • Question on Rogue Detection

    Hi All,
    I have a question regarding rogue detection configuration on WLC.
    we know that rogue detection can be enabled on a per AP basis under the advanced tab of each AP, starting from code 6.0, and it also supports rogue detection in RF groups when we configure protection type as "AP Authentication" under WLC security tab, which will make APs to authentication frames based on the RF group name, if name is different, then the AP is considered as a rogue.
    so the question is if we only enable rogue detection on the AP level, however leave the AP authentication selected as "none", how does the AP detect rogues? does that mean if any signal detected is not from the APs connected to the WLC, then this will be considered as a rogue?
    also in the configuration guide, under the section "enable rogue access point detection in RF groups", it says rogue detection will need the AP to be configured as either local or monitor mode, when we also have AP authentication enabled. however if an AP is under h-reap mode, we still able to enable/disable rogue detection under the advanced tab, so how does H-REAP mode APs detect rogues? is that the same method as when AP authentication selected as "none"
    thanks in advance for your help.

    I've done some tests as well:
    I have multiple WLCs on same mobility and same RF groups. AP Auth type set to "none" on all o ft hem. I took one WLC (I'll call it thereafter "My WLC") and changed its RF group name. I also cahnged its AP auth policy to "AP Authentication". All WLCs have same SSIDs configured. I added one extra test SSID on "MY WLC".
    The results are:
    - The WLC with different RF group name did not mention other APs as rogues. Other APs did not mention my WLC APs as rogues as well.
    - There is very high number of AP impersonation detected by "My WLC". other WLCs did not detect ap impersonation. This indicates that other APs on other WLCs try to contain "My WLC" APs. However, "My WLC" does not seem to try impersonating other APs. (it worths to notice that number of APs on "My WLC" is much less than APs on other WLCs).
    - When using "AP authentication", there is a new IE appears in the SSID beacons.
    The highlighted in blue is that information that could not be interpretted (as seen in highlighted yellow above). This information differs based no the SSID. Different SSID name shows different information. This IE seems to carry the information about the RF group name. If this does not appear when using "none" as AP auth policy then WLCs can not distinguish different RF group names if ap auth set to "none". (because I could not find any RF group info anywhere in the beacon packet. If you know it is exist somewhere else please let us know. So far I assume it is included in this vendor specific IE).
    - When I changed the AP auth to "none" the number of AP impersonation reported started to decrease gradually. I'll keep monitoring to see what it will be after couple of hours.
    - Config guide is very useful. However, sometimes it is extremley stupid. Why?
         well, because if you go to the part that talks about configuring MFP (http://tiny.cc/un6thw), and if you go to Step 5,      you will find that the optoin metnioned in step 5 is not available in the AP. It tells you that to enable or disable MFP      validation for specific AP you can do this from under Advanced tab. However, this option is not available under      Advanced tab. I had a big discussion with TAC about this very long time ago. prompted to doc guys about it but so      far nothign changed.
    HTH
    Amjad

  • Regarding count for each type Trace entry

    Hi Friends,
    I am using ALV grid Display to display the Result.
    my requirement is to display report with sorting & Count for each entry on a particular field.
    Can anybody give me the idea or smalll code on this Plz...
    Thanks in advance.
    Regards,
    Ravish

    Hi,
    For sorting you can use standard ALV sorting functionality. (Pass the parameter it_sort by filling the sort field name and sort order like up or down(Either one).
    For count you need to keep explicit logic.
    Sample code.
    SORT i_final BY field1. "Your count field criteria.
    LOOP AT i_final INTO wa_final.
    ADD 1 TO l_count.
    AT END OF field1.
    MOVE l_count TO wa_final-count.
    MODIFY i_final FROM wa_final WHERE field1 = wa_final-field1 TRANSPORTING count.
    CLEAR l_count.
    ENDON.
    ENDLOOP.
    Make sure that your count based field is the first field in itab. For displaying the output you can adjust the fieldcat.
    Thanks,
    Vinod.

  • Inventory count for Various Stock types

    What is Inventory count for Various Stock types?
    i have to upload data to this.
    can anyone explain this and give the tcode for this.
    Regards,
    Vimal

    Hi,
    While taking up physical inventory you have the option of doing it for different stock types being maintained .Like Quality stock,unrestricted stock ,blocked stock.If you are doing this activity in sessions in MI31 ,you need to check against the stock types which are to be counted.This will include the stock of the items as selected and leave aside the stock types not selected.In MI01 also you can select these stock types which are donated by 1,2,3 & 4 stock type.After creating the document the stock counted is to be entered in MI04 .Than get the difference list in MI20.The difference will be posted in MI07 which will complete the activity and stock will be adjusted after posting tyhe difference.
    Dhruba

  • Rogue Detection and SPT issues

    Deployed wireless a few months. From a client to infrastrure standpoint, majority of users are happy with the ability to go wireless with their personal and work devices.
    The problem we're facing is proper identification of rogue's AP's on our wired network (hot spots aren't important)
    I've setup a few linksys AP's connected to our access switches and found WLC/PRIME finds the rogue AP's but when a SPT is performed, both WLC/PRIME state it's not on the wired network (which is not true). If I do a manual trace, in Prime,  it will work but I can't do a manual trace everytime I get an alert (we're in a major US city). Further investigation shows the lan and wlan mac address of this linksys router is +/- from one another (confirmed by with arp table on access switch and going into prime and looking at the alert).. Which in this case, Prime should see it as WIRED and mark it as a ROGUE and alert me
    Found a document
    http://www.cisco.com/en/US/customer/docs/wireless/prime_infrastructure/1.3/configuration/guide/admin.html#wp1603927 stating only the following switches are supported: 3750, 3560, 3750E, 3560E, and 2960.
    I can't see how these are the only supported devices, most are older than the 4510. I posted this in another thread and a rep provided me the link
    http://www.cisco.com/en/US/products/ps6366/products_tech_note09186a0080b40901.shtml
    Read this and even went further and read ROGUE MANAGMENT WHITE PAPER
    http://www.cisco.com/en/US/products/ps6366/products_tech_note09186a0080b40901.shtml
    This does not mention a limitation of switches support. States if CDP and SNMP is enable, along with the local access switches added to PRIME it should work
    Here is the currently list of deployed devices, code and basic configuration
    Access Switches - 4510 - image: cat4500e-universalk9.SPA.03.02.02.SG.150-2.SG2.bin
    WLC - 5500 - image 7.4.103.9
    AIR-CAP3602I-A-K9 - 152 deployed, 151 are configured for Local Mode, 1 is configured as Rogue Detector (trunked with all access vlan's passing thru)
    RLDP is enabled on all Local Mode AP's - which after reading is not best practice because of time slicing and the fact is degrades client quality and can kick users off
    Basically looking for feedback from others who have deployed wireless and have succesfully configured their environement for ROGUE AP DETECTION with SPT.. What are your thoughts and what do you run?
    Thanks in advance

    Mark:
    Complaints about the performance of Switchport Tracing are pretty common.  The best way to build this out is to start with your planted rogue AP is connected to the same switch that your Prime Infrastructure server connects to--or the first wired switch that ESX/ESXi host connects to--and validate that it works there, make whatever changes you need to get it working, then move the planted rogue AP to the next switch and so on.  The logging modules Configuration, General, Monitor, GUI, System and Tools should cover everything you need to know why Switchport Tracing isn't giving the results you expect.  This "start small and work your way up" helps you learn lessons about what needs to be configured on all your switches to have it working the way you want it to.
    Configuring Switchport Tracing

  • Rogue detection with Prime 2.1

    Hi@all,
    i know many questions in the last days, but i must say, the last WCS works better as the compination Prime 2.1 and 5760 ;).
    My problem, we have a huge campus and at peaks ~ 1500 rogue-aps. 
    In my new configuration (2x 5760 and Prime 2.1), the wlc see the rogue-aps but in the security dashboard at the prime no rogue are listet.
    The 5760 are in the same mobility/rf-group, the polling interval at the Prime are 15 minutes.
    Maybe some one has a similar problem and could help.
    regards
      René

    Hi
    Do you see the rogue AP on 5760 itself ? "show wireless wps rogue ap summary" output shows you the identified rogue APs. If you can't see anything there, then you may not enable Rogue AP detection on your controller. See whether in your 5760 configuration, the first line below is configured (which will enable rogue detection). Second line is to increase the threshold to minimize false detection. Refer 5760 RRM config guide for more details.
    wireless wps ap-authentication
    wireless wps ap-authentication threshold 50
    This document describe some of the best practices of 5760 configuration including rogue detection as well.
    Cisco 5760 IOS Wireless LAN Controller Configuration Best Practices
    HTH
    Rasika
    **** Pls rate all useful responses ****

  • I/O count for multipath device on each path

    Hi,
    I am using MPxIO (Bundled multipath) in my Solaris 10 (SPARC) setup for LDEVs from a Hitachi storage (USP-V), each LDEV is being accessed using two paths from the server. I want to verify the I/O count on each of the paths for LDEVs any idea what OS command I may use to verify this.
    Thanks in advance.
    Solomon.

    Hi Nik,
    iostat -Y <device Name> - does show the I/O count for all available paths. E.g.:
    iostat -Y ssd30 3 6 extended device statistics
    device r/s w/s kr/s kw/s wait actv svc_t %w %b
    ssd30 2.7 0.6 25.7 211.8 0.0 0.0 0.6 0 0
    ssd30.t2 1.3 0.2 12.6 70.0 0.0 0.0 0.0 0 0
    ssd30.t2.fp4 1.3 0.2 12.6 70.0 0.0 0.0 0.0 0 0
    ssd30.t3 1.3 0.2 13.1 141.8 0.0 0.0 0.0 0 0
    ssd30.t3.fp0 1.3 0.2 13.1 141.8 0.0 0.0 0.0 0 0
    extended device statistics
    device r/s w/s kr/s kw/s wait actv svc_t %w %b
    ssd30 0.3 10.3 2.7 9230.8 0.0 0.0 4.2 0 4
    ssd30.t2 0.0 5.3 0.0 4591.4 0.0 0.0 0.0 0 0
    ssd30.t2.fp4 0.0 5.3 0.0 4591.4 0.0 0.0 0.0 0 0
    ssd30.t3 0.3 5.0 2.7 4639.5 0.0 0.0 0.0 0 0
    ssd30.t3.fp0 0.3 5.0 2.7 4639.5 0.0 0.0 0.0 0 0
    extended device statistics
    device r/s w/s kr/s kw/s wait actv svc_t %w %b
    ssd30 0.7 11.3 5.3 9357.6 0.0 0.1 5.8 0 7
    ssd30.t2 0.0 6.0 0.0 5244.3 0.0 0.0 0.0 0 0
    ssd30.t2.fp4 0.0 6.0 0.0 5244.3 0.0 0.0 0.0 0 0
    ssd30.t3 0.7 5.3 5.3 4113.3 0.0 0.0 0.0 0 0
    ssd30.t3.fp0 0.7 5.3 5.3 4113.3 0.0 0.0 0.0 0
    It seems iostat -Y <Dev Name> detects only WRITE I/O and doesn't detect READ I/O for my case not sure if that works for others.
    You are correct I can see the traffic in Hitachi storage but I wanted to check from the OS, thank you for your help.
    Thanks all for your replies.

  • Rogue detection

    Hi,
    I would need some clarifications about rogue AP detection. First, in order to configure the passive rogue detection is it necessary to just setup a rogue detector AP or I also need to enable RLDP? Second, in your experience how much is it reliable?
    Thanks,
    Matteo

    Hi Matteo:
    Passive rogue detection is just on--no rogue detector AP required!  Just like anything else in life, the more resources you put toward something, the better it's going to be.  If you have AP Authentication or MFP configured (which you should anyway), you'll have fewer false alarms and the routines will know not to call your own APs rogues.  RLDP will tell you if a rogue AP is just cabled up in your network but doesn't have any clients yet and will allow you to do switchport tracing to find one from the switch side.  Rogue Detector APs don't handle client traffic, they just dedicate themselves to listening and reporting rogue activity back to the controller.  In a world where budgets are tight, we hear that it can be tough to get funding for APs that don't service clients.  Again, you don't *have* to do any of it, just the more you put in, the more accurate your results will be.
    As for inaccuracies, that usually comes from folks having things misconfigured in their network or not having enough configured (i.e. choosing to not do RLDP or Rogue Detectors.)
    Sincerely,
    Rollin Kibbe
    Network Management Systems Team

  • Admin Status for Rogue AP

    Hi ,
    We have 1242-AG series AP which is configured in Rogue Detector mode. After adding this AP to WLC its showing Admin Status of AP as Down.
    When i am trying to enable the Admin Status its giving me following error
    " Admin status cannot be enabled for AP in Rogue Detector mode".
    Any suggestions on how to enable Admin Status for Rogue Detector AP.
    Thanks
    Prasad

    Rogue Detection under Unified Wireless Networks
    http://www.cisco.com/en/US/tech/tk722/tk809/technologies_white_paper09186a0080722d8c.shtml
    This may help along with Steves answer

  • KB15N_No adjustment account found for cost element Message no. K5112

    When I am trying to post Manual Cost Allocation through TC KB15N with the following input data I am getting the following error message and the same could not be posted.  Kindly advise.
    Screen Variant used: 01 SAP Cost Center
    Input Type: List Entry
    Item No.1
    Sender Cost Center : 3402100942
    Cost Element: 6200001
    Amount : 62,201.56
    Receiving Cost Center: 3405100945
    First four digits represent profit center code.  If first four digits are equal the above error is not coming. But posting is needed with different profit centers.
    No adjustment account found for cost element
    Message no. K5112
    Diagnosis
    Neither standard account determination nor the enhanced function found an adjustment account for the reconciliation posting.
    System Response
    No adjustment account could be determined for cost element  in company code SCCL.
    Procedure
    Maintain the standard or enhanced account determination for transaction KAMV. Information on maintenance can be found in the program documentation.
    Execute

    Hi all,
    I face the issue like this but with transaction KOAP - Plan settlement
    But, the problem is that, I do not active reconciliation ledger, so I do not maintain any thing relate to reconciation ledger or adjustment posting? I can do transaction "actual settlement"  without error
    So, How this error come to me?
    And how I can fix it?
    Thanks all!

  • No Adjustment account found for cost element

    Dear Gurus,
    I am getting Three errors  msg "No Adjustment account found for cost element" when i try to run the conformation of production order create  ( T Code : C015 )"  and I am not able to save the record . like
    1 ).No adjustment account found for cost element
    Message no. K5112
    Diagnosis
    Neither standard account determination nor the enhanced function found an adjustment account for the reconciliation posting.
    System Response
    No adjustment account could be determined for cost element  in company code XXXX
    Procedure
    Maintain the standard or enhanced account determination. Information on maintenance can be found in the program documentation.
    Execute
    2) . No adjustment account found for cost element XXXXXXXX
    Message no. K5112
    Diagnosis
    Neither standard account determination nor the enhanced function found an adjustment account for the reconciliation posting.
    System Response
    No adjustment account could be determined for cost element XXXXXXX in company code XXXX.
    Procedure
    Maintain the standard or enhanced account determination. Information on maintenance can be found in the program documentation.
    Execute
    3 ) No account is specified in item 0000000002
    Message no. F5670
    Diagnosis
    No account was specified for account type "S" in item "0000000002" of the FI/CO document.
    System Response
    The Financial Accounting program cannot process the document.
    Procedure
    A system error has probably occurred in the application you called up. Check the data transferred to item "0000000002" of the FI/CO document.
    Could anyone please help me with this.
    Regards
    SAP CO

    Hi,
    iam not able to understand of this  SAP Notes: 531606 and 1027645
    Could you pl give me full details for come out this problem.
    Regards
    SAP CO

  • There was an error while updating row count for "SH".."SH".CHANNELS

    Hi All,
    Am new to OBIEE.Pls help in this regard.
    Am building the physical layer as per Repository guide.When am importing the data in to this,am getting the below error.
    *"There was an error while updating row count for "SH".."SH".CHANNELS" :"*
    channles is the table name and having 5 rows.
    but am able to see the data in the sql prompt. like SELECT * FROM SH.CHANNELS then 5 rows data would be displaying..
    pls help in this regard and where is the excat problem?
    Thanks,

    what is the error?
    Make sure that your connection pool settings are okay..
    Make sure that, you are using correct driver in case of if you are using ODBC dsn..
    Also make sure that, your oracle server is running... TNS and Oracle server services

  • How do I show a count for rows that don't exist?

    Hi, I'm trying to count the number of records grouped by rank(B,C,R),month,and year. Basically, anytime a part fails testing a record is entered which records the failure Rank and occurrence date. A record is only inserted if a part failed for specific rank. So not all 3 ranks will have entries. I'm able to count all ranks by month,year that do exist. But how do I get values of 0 for the ranks that don't exist? I just created a table qa_rank that has just one column rank with 3 records(b,c,r). but its not being used as of now. rank is just a column in qa_occ record.Here is my query.
    select to_char(occdate,'YY') as yr, to_char(occdate,'MM') as mn,
    rank, count(occdate)
    from qa_occ
    where q.occdate between '1-Apr-2005'and '31-Mar-2006'
    and q.supplier = '11107'
    group by to_char(q.occdate,'YY'),to_char(q.occdate,'MM'),q.rank
    order by to_char(q.occdate,'YY'),to_char(q.occdate,'MM')
    which returns this
    YY MM RANK COUNT(OCCDATE)
    05 09 C 2
    05 10 C 2
    05 11 C 1
    05 11 R 1
    06 01 C 3
    06 02 C 1
    06 03 B 1
    06 03 C 2
    I need it to return C,B,R for everymonth. If no records exist then the count for the month,rank should be 0. Any ideas? Thanks.

    something like:
    SQL> with qa_occ as
      2  (select to_date('09/15/2005','mm/dd/yyyy') occdate, 'B3661-RYPX-A000' part, 'C' rank, 4 indexpoints from dual
      3   union all
      4   select to_date('09/25/2005','mm/dd/yyyy') occdate, 'B3661-RYP-A000' part, 'C' rank, 4 indexpoints from dual
      5   union all
      6   select to_date('10/11/2005','mm/dd/yyyy') occdate, null part, 'C' rank, 7 indexpoints from dual
      7   union all
      8   select to_date('10/20/2005','mm/dd/yyyy') occdate, 'B3661-RYP-A000' part, 'C' rank, 4 indexpoints from dual
      9   union all
    10   select to_date('11/11/2005','mm/dd/yyyy') occdate, null part, 'C' rank, 4 indexpoints from dual
    11   union all
    12   select to_date('11/18/2005','mm/dd/yyyy') occdate, 'B3661-RYPX-A000' part, 'R' rank, 0 indexpoints from dual
    13   union all
    14   select to_date('01/11/2006','mm/dd/yyyy') occdate, 'B3661-RYP-A000' part, 'C' rank, 4 indexpoints from dual
    15   union all
    16   select to_date('01/25/2006','mm/dd/yyyy') occdate, '3511-RNA0-0111' part, 'C' rank, 4 indexpoints from dual
    17   union all
    18   select to_date('01/27/2006','mm/dd/yyyy') occdate, '3511-RNA0-0111' part, 'C' rank, 4 indexpoints from dual
    19   union all
    20   select to_date('02/15/2006','mm/dd/yyyy') occdate, '3511-RNA0-0111' part, 'C' rank, 4 indexpoints from dual
    21   union all
    22   select to_date('03/07/2006','mm/dd/yyyy') occdate, 'B3661-RYP-A000' part, 'C' rank, 4 indexpoints from dual
    23   union all
    24   select to_date('03/14/2006','mm/dd/yyyy') occdate, 'B3661-RYP-A000' part, 'C' rank, 4 indexpoints from dual
    25   union all
    26   select to_date('03/15/2006','mm/dd/yyyy') occdate, '3511-RNA0-0111' part, 'B' rank, 13 indexpoints from dual)
    27  select * from qa_occ;
    OCCDATE   PART            R INDEXPOINTS
    15-SEP-05 B3661-RYPX-A000 C           4
    25-SEP-05 B3661-RYP-A000  C           4
    11-OCT-05                 C           7
    20-OCT-05 B3661-RYP-A000  C           4
    11-NOV-05                 C           4
    18-NOV-05 B3661-RYPX-A000 R           0
    11-JAN-06 B3661-RYP-A000  C           4
    25-JAN-06 3511-RNA0-0111  C           4
    27-JAN-06 3511-RNA0-0111  C           4
    15-FEB-06 3511-RNA0-0111  C           4
    07-MAR-06 B3661-RYP-A000  C           4
    14-MAR-06 B3661-RYP-A000  C           4
    15-MAR-06 3511-RNA0-0111  B          13
    13 rows selected.
    assuming that there are only three ranks available B, C,and R we considered this as a lookup values. now in the query below we incorporate an inline view for the lookup values:
    SQL> with qa_occ as
      2  (select to_date('09/15/2005','mm/dd/yyyy') occdate, 'B3661-RYPX-A000' part, 'C' rank, 4 indexpoints from dual
      3   union all
      4   select to_date('09/25/2005','mm/dd/yyyy') occdate, 'B3661-RYP-A000' part, 'C' rank, 4 indexpoints from dual
      5   union all
      6   select to_date('10/11/2005','mm/dd/yyyy') occdate, null part, 'C' rank, 7 indexpoints from dual
      7   union all
      8   select to_date('10/20/2005','mm/dd/yyyy') occdate, 'B3661-RYP-A000' part, 'C' rank, 4 indexpoints from dual
      9   union all
    10   select to_date('11/11/2005','mm/dd/yyyy') occdate, null part, 'C' rank, 4 indexpoints from dual
    11   union all
    12   select to_date('11/18/2005','mm/dd/yyyy') occdate, 'B3661-RYPX-A000' part, 'R' rank, 0 indexpoints from dual
    13   union all
    14   select to_date('01/11/2006','mm/dd/yyyy') occdate, 'B3661-RYP-A000' part, 'C' rank, 4 indexpoints from dual
    15   union all
    16   select to_date('01/25/2006','mm/dd/yyyy') occdate, '3511-RNA0-0111' part, 'C' rank, 4 indexpoints from dual
    17   union all
    18   select to_date('01/27/2006','mm/dd/yyyy') occdate, '3511-RNA0-0111' part, 'C' rank, 4 indexpoints from dual
    19   union all
    20   select to_date('02/15/2006','mm/dd/yyyy') occdate, '3511-RNA0-0111' part, 'C' rank, 4 indexpoints from dual
    21   union all
    22   select to_date('03/07/2006','mm/dd/yyyy') occdate, 'B3661-RYP-A000' part, 'C' rank, 4 indexpoints from dual
    23   union all
    24   select to_date('03/14/2006','mm/dd/yyyy') occdate, 'B3661-RYP-A000' part, 'C' rank, 4 indexpoints from dual
    25   union all
    26   select to_date('03/15/2006','mm/dd/yyyy') occdate, '3511-RNA0-0111' part, 'B' rank, 13 indexpoints from dual)
    27  select qa.yr, qa.mn,
    28         decode(qa.rank,lk.rank,qa.rank,lk.rank) rank,
    29         sum(decode(qa.rank,lk.rank,qa.cnt,0)) cnt
    30    from (select to_char(qo.occdate,'YY') as yr,
    31                 to_char(qo.occdate,'MM') as mn,
    32                 qo.rank,
    33                 count(qo.occdate) cnt
    34            from qa_occ qo
    35          group by to_char(qo.occdate,'YY'),
    36                   to_char(qo.occdate,'MM'),
    37                   qo.rank) qa,
    38         (select 'B' rank from dual
    39          union all
    40          select 'C' rank from dual
    41          union all
    42          select 'R' rank from dual) lk
    43  group by qa.yr, qa.mn, decode(qa.rank,lk.rank,qa.rank,lk.rank)
    44  order by qa.yr, qa.mn, decode(qa.rank,lk.rank,qa.rank,lk.rank);
    YR MN R        CNT
    05 09 B          0
    05 09 C          2
    05 09 R          0
    05 10 B          0
    05 10 C          2
    05 10 R          0
    05 11 B          0
    05 11 C          1
    05 11 R          1
    06 01 B          0
    06 01 C          3
    06 01 R          0
    06 02 B          0
    06 02 C          1
    06 02 R          0
    06 03 B          1
    06 03 C          2
    06 03 R          0
    18 rows selected.
    SQL>

  • Get the Count for each row

    I'm trying to get the count for each row to total count for each month
    Something like this
    Hardware     |      Jan
    Monitors       |       5
    Processors   |      137
    Printers        |      57
    etc........
    How can I write a query for this. I can get the Hardware column but don't know how to get the next column.

    If you can provide more data like sample input DML statements it would have been wonderful..
    Assuming is , you need a pivot. Here is an article on basic Pivot..
    http://sqlsaga.com/sql-server/how-to-use-pivot-to-transform-rows-into-columns-in-sql-server/
    something like this may be..
    DECLARE @Input TABLE
    Hardware VARCHAR(20),
    [Date] VARCHAR(20)
    INSERT INTO @Input VALUES('Monitor', '01/01/2014'), ('CPU', '01/01/2014'), ('Monitor', '01/03/2014')
    , ('ABC', '01/01/2014'),('Monitor', '02/01/2014')
    ;WITH CTE AS
    SELECT Hardware, LEFT(DATENAME(M, [Date]),3) AS [MonthName] FROM @Input
    SELECT *
    FROM
    SELECT Hardware, [MonthName], COUNT(Hardware) AS Count FROM CTE GROUP BY Hardware, [MonthName]) a
    PIVOT (MAX([Count]) FOR [MonthName] IN ([Jan], [Feb])) pvt
    Please mark as answer, if this has helped you solve the issue.
    Good Luck :) .. visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.

  • How to get row count(*) for each table that matches a pattern

    I have the following query that returns all tables that match a pattern (tablename_ and then 4 digits). I also want to return the row counts for these tables.
    Currently a single column is returned: tablename. I want to add the column RowCount.
    DECLARE @SQLCommand nvarchar(4000)
    DECLARE @TableName varchar(128)
    SET @TableName = 'ods_TTstat_master' --<<<<<< change this to a table name
    SET @SQLCommand = 'SELECT [name] as zhistTables FROM dbo.sysobjects WHERE name like ''%' + @TableName + '%'' and objectproperty(id,N''IsUserTable'')=1 ORDER BY name DESC'
    EXEC sp_executesql @SQLCommand

    The like operator requires a string operand.
    http://msdn.microsoft.com/en-us/library/ms179859.aspx
    Example:
    DECLARE @Like varchar(50) = '%frame%';
    SELECT * FROM Production.Product WHERE Name like @Like;
    -- (79 row(s) affected)
    For variable use, apply dynamic SQL:
    http://www.sqlusa.com/bestpractices/datetimeconversion/
    Rows count all tables:
    http://www.sqlusa.com/bestpractices2005/alltablesrowcount/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

Maybe you are looking for