Query to find the number of main meter and its corresponding sub meter

Hi Expert,
I need to build a query to derieve the main meter & it corresponding sub meter in SAP system
Please could you let me the table which i should join

Check out tables EQUI-EGERS-ETDZ
Thanks,
Murtuza

Similar Messages

  • Query to find the user ID create date and locked date

    Hi,
    As title, below is my query, it seem that it will not work as my expectation, can someone help?
    SELECT T0.[USER_CODE], T0.[U_NAME], T0.[LOCKED], T0.[LstLogoutD] AS 'Last Logon Date' , T1.[CreateDate]  FROM OUSR T0  INNER JOIN AUSR T1 ON T0.USERID = T1.userSign WHERE T0.[LOCKED] = 'N' AND
          T1.logInstanc = 1
    Thanks

    Try this
    After the Mr. Nagarajan post
    SELECT
    T0.[USER_CODE], T0.[U_NAME], Case when Isnull((Select Min(T1.date) from usr5 T1 where T0.USER_Code = T1.usercode GROUP by T1.Usercode), 0) <> 0 then (Select Min(T1.date) from usr5 T1 where T0.USER_Code = T1.usercode GROUP by T1.Usercode) else T0.[updateDate] end 'Creation date', T0.[lastLogin], T0.[Locked] FROM [dbo].[OUSR] T0
    Regards,

  • How to find the number of ODBC connections to Oracle Database

    Hi All,
    How to find the number of ODBC connections and all connections to the Database in last week. Are there any views to get this information?
    Thanks in advance,
    Mahi

    What Ed said is true that Oracle doesn't note which type of protocol is connecting to the database, however, you can see which program is accessing the database.
    For example: if you already know of a user using ODBC, you can verify as:
    select username, osuser, terminal, program from v$session where username = 'SCOTT'
    USERNAME                 OSUSER          TERMINAL   PROGRAM
    SCOTT                    IUSR_SRV231     SRV231     w3wp.exe
    SCOTT                    IUSR_SRV231     SRV231     w3wp.exe
    2 rows selected.Assuming that you can confirm the progam noted in the above (example) is the one using ODBC, then you can change the query such as:
    SQL> select username, osuser, terminal, program from v$session where program = 'w3wp.exe';
    USERNAME                 OSUSER          TERMINAL   PROGRAM
    SCOTT                    IUSR_SRV231     SRV231     w3wp.exe
    SCOTT                    IUSR_SRV231     SRV231     w3wp.exe
    2 rows selected.Just for kicks, I checked our listener.log file, but there was no reference of odbc in it either.
    Hope this helps...

  • How do I find the number of physical CPUs , number of cores in OEL ?

    In RHEL , it is easy to find the number of Physical CPUs and the number of cores within each CPU
    -- Ouput from Red Hat Enterprise Linux 5.4
    -- This a real machine. Not a VM
    $ cat /proc/cpuinfo
    processor       : 0
    vendor_id       : GenuineIntel
    cpu family      : 6
    model           : 46
    model name      : Intel(R) Xeon(R) CPU           X7550  @ 2.00GHz
    stepping        : 6
    cpu MHz         : 1995.048
    cache size      : 18432 KB
    physical id     : 0              --------------> This will give info on the physical CPU
    siblings        : 8
    core id         : 0
    cpu cores       : 8              --------------> This will give the number of cores within a CPU
    apicid          : 0
    fpu             : yes
    fpu_exception   : yes
    cpuid level     : 11
    wp              : yes
    flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx rdtscp lm constant_tsc ida nonstop_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr popcnt lahf_lm
    bogomips        : 3990.09
    clflush size    : 64
    cache_alignment : 64
    address sizes   : 44 bits physical, 48 bits virtual
    power management: [8]Output from Oracle Linux . Physical CPU Id and Number of Cores info is missing.
    -- Output from Oracle Enterprise Linux 6.3
    -- This is a virtual machine created using Virtual Box
    -- Processor ID , number of cores is missing
    $ cat /proc/cpuinfo
    processor       : 0
    vendor_id       : GenuineIntel
    cpu family      : 6
    model           : 42
    model name      : Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
    stepping        : 7
    cpu MHz         : 2298.627
    cache size      : 6144 KB
    fpu             : yes
    fpu_exception   : yes
    cpuid level     : 5
    wp              : yes
    flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc up rep_good nopl pni monitor ssse3 lahf_lm
    bogomips        : 4597.25
    clflush size    : 64
    cache_alignment : 64
    address sizes   : 36 bits physical, 48 bits virtual
    power management:Is this the expected output in Oracle Enterprise Linux ? If so, how can I find the number of Physical CPUs and the number of cores within a Physical CPU in OEL?
    Is this info missing because I am running OEL in a virtual machine ?

    Oracle Linux behaves exactly like Red Hat in this matter an /proc/cpuinfo can be used for that. I guess this is because you have set up VirtualBox to only assign one virtual CPU to your guest Linux.
    processor     : 0
    vendor_id     : AuthenticAMD
    cpu family     : 15
    model          : 33
    model name     : Dual Core AMD Opteron(tm) Processor 275
    stepping     : 2
    cpu MHz          : 1000.000
    cache size     : 1024 KB
    physical id     : 0
    siblings     : 2
    core id          : 0
    cpu cores     : 2
    apicid          : 0
    initial apicid     : 0
    fpu          : yes
    fpu_exception     : yes
    cpuid level     : 1
    wp          : yes
    flags          : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow rep_good extd_apicid pni lahf_lm cmp_legacy
    bogomips     : 1994.47
    TLB size     : 1024 4K pages
    clflush size     : 64
    cache_alignment     : 64
    address sizes     : 40 bits physical, 48 bits virtual
    power management: ts fid vid ttpAnother example is this one, OEL 5.6 inside of VirtualBox but with 2 virtual CPUs assigned:
    [root@oel56proxy ~]# cat /proc/cpuinfo
    processor       : 0
    vendor_id       : GenuineIntel
    cpu family      : 6
    model           : 23
    model name      : Intel(R) Core(TM)2 Duo CPU     P8600  @ 2.40GHz
    stepping        : 10
    cpu MHz         : 2064.652
    cache size      : 6144 KB
    physical id     : 0
    siblings        : 2
    core id         : 0
    cpu cores       : 2
    apicid          : 0
    fdiv_bug        : no
    hlt_bug         : no
    f00f_bug        : no
    coma_bug        : no
    fpu             : yes
    fpu_exception   : yes
    cpuid level     : 5
    wp              : yes
    flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc pni ssse3 lahf_lm
    bogomips        : 4129.30
    processor       : 1
    vendor_id       : GenuineIntel
    cpu family      : 6
    model           : 23
    model name      : Intel(R) Core(TM)2 Duo CPU     P8600  @ 2.40GHz
    stepping        : 10
    cpu MHz         : 2064.652
    cache size      : 6144 KB
    physical id     : 0
    siblings        : 2
    core id         : 1
    cpu cores       : 2
    apicid          : 1
    fdiv_bug        : no
    hlt_bug         : no
    f00f_bug        : no
    coma_bug        : no
    fpu             : yes
    fpu_exception   : yes
    cpuid level     : 5
    wp              : yes
    flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc pni ssse3 lahf_lm
    bogomips        : 7494.15I have not tried to replicate this with a VM that only has one vCPU assigned but I guess that is why you only see one CPU and no processor_id and so on.
    Bjoern

  • How do I find the number of users returned by a cfldap query?

    How do I find the number of users returned by a cfldap query?
    I'm not allowed to do something like:
    <cfif ArrayLen(results.rows) gt 1>
    I then get an error:
    faultCode:Server.Processing faultString:'Unable to invoke CFC - Object of type class coldfusion.tagext.net.LdapResultTable cannot be used as an array' faultDetail:''
    Many thanks for any light you can shed

       Cheers again Ian for your many helps,
    it now won't let me do
    <cfqueryparam value="#results.USNCreated#" cfsqltype="cf_sql_varchar">
    I get the message:
    faultCode:Server.Processing faultString:'Unable to invoke CFC - Error Executing Database Query.' faultDetail:'[Macromedia][SQLServer JDBC Driver][SQLServer]The name "results.USNCreated" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.'

  • Query to find the class name that has the maximum number of students ?

    I need the query to find the [class Name] which has the most number of students. please look below at the tables
    Students Table                                                                     
    StudentId     StudentName  ClassID                                    
    1                  xxx                   1                                           
    2                  yyy                   1                                           
    3                  zzz                   1  
    4                  fff                    2
    5                   ttt                  2
     Classes Table
     ClassID          ClassNane
     1                    CSHARP
     2                    JSHARP
    The result should be : CSHARP
    since there are 3 students in CSHARP and 2 students in JSHARP class
    Appreciate your help
    Thanks

    Try:
    DECLARE @Classes TABLE (
    ClassID INT identity(1, 1) PRIMARY KEY
    ,ClassName VARCHAR(50)
    INSERT INTO @Classes (ClassName)
    VALUES ('CSharp')
    ,('JSharp')
    DECLARE @Students TABLE (
    StudentID INT identity(1, 1) PRIMARY KEY
    ,StudentName VARCHAR(10)
    ,ClassID INT
    INSERT INTO @Students (
    StudentName
    ,ClassID
    VALUES (
    'xxx'
    ,1
    'yyy'
    ,1
    'zzz'
    ,1
    'fff'
    ,2
    'ttt'
    ,2
    SELECT TOP (1)
    WITH TIES C.ClassName
    FROM @Classes C
    INNER JOIN @Students S ON C.ClassID = S.ClassID
    GROUP BY C.ClassID
    ,C.ClassName
    ORDER BY COUNT(S.StudentID) DESC
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Trying to find the number of rows in a ResultSet

    I am trying to find the number of rows in a ResultSet, using the following code:
    rs = st.executeQuery(query);
    rs.last(); // to move the cursor to the last row
    System.out.println(rs.getRow());
    However, I am getting this error:
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Unsupported method: ResultSet.last
    Whats going wrong??

    praveen_potru wrote:
    You might have not used scrollable result set..
    Try like this:
    stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);rs = stmt.executeQuery(sqlString);
    // Point to the last row in resultset.
    rs.last();
    // Get the row position which is also the number of rows in the ResultSet.
    int rowcount = rs.getRow();
    System.out.println("Total rows for the query: "+rowcount);
    cheersAnd I hope the OP would read it because the thread is a year old.

  • Query to find the no of columns in a table

    Is there a query to find the total number of columns in a table?

    Dou you know read?
    -- the number of rows in a table named yourtable:
    select count(1) from yourtable;
    -- the number of columns in a table
    -- If is a user's table:
    select count(1)
    from user_tab_columns
    where table_name='YOURTABLE'
    --If it is´t
    select count(1)
    from DBA_tab_columns
    where owner = 'USEROWNER'
    and table_name='YOURTABLE'

  • Query to find vendor number with whom a particular item was last purchased.

    Hi All,
    I want to frame a SQL query to find vendor number with whom a particular item was last purchased.
    I got to know that we can find this by looking at the open Purchase Order or the Material Transactions for the transaction type of ‘PO Receipt’ whichever is the latest.
    Can anyone please help me in framing such query.
    Regards,
    Shruti

    Here is a hint
    Use the mtl_system_items_b table to get the inventory_item_id.
    Use it in the po_lines_all table to get po_header_id
    Use it in po_headers_all table to get vendor_id
    Use it in po_vendors to get segment1 (i.e. vendor#)
    Hope this helps,
    Sandeep Gandhi

  • Query to find the size of trigger?

    query to find the size of trigger?

    Can you define what the size of a trigger would be?
    I suppose one measure might be to get the DDL for the trigger (DBMS_METADATA.GET_DDL) and do a DBMS_LOB.GetLength on the CLOB that is returned. I'm hard-pressed to find that a meaningful number, but it is a measure of "size".
    Justin

  • How to find the number of occurence of a string

    String str="The AR tech seeks experienced candidates in java,jsp. The candidates should have atleast 1 year of experience in the specified skills.";
    here i need to find the number of occurence of the string "experience".
    how to find it out?

    String str="The AR tech seeks experienced candidates in java,jsp. The candidates should have atleast 1 year of experience in the specified skills.";
    String findStr = "experience";
    int count = 0;
    int index = 0;
    while(index != -1) {
    index = str.indexOf(findStr, (count == 0 ? 0 : index + findStr.length()));
    if(index != -1) {
    count++;

  • How to find the number of data items in a file written with ArryToFile function?

    I have written an array of number in 2 column groups to a file using the LabWindows/CVI function ArrayToFile...Now if I want to read the file with FileToArray Function then how do I know the number of items in the file. during the write time I know how many array items to write. but suppose I want the file to read at some later time then How to find the number of items in the file,So that I can read the exact number and present it. Thanks to all
    If you are young work to Learn, not to earn.
    Solved!
    Go to Solution.

    What about:
    OpenFile ( your file );
    cnt = 0;
    while ((br = ReadLine ( ... )) != -2) {
    if (br == -1) {
    // I/O error: handle it!
    break;
    cnt++;
    CloseFile ( ... );
    There are some ways to improve performance of this code, but if you are not reading thousands of lines it's quite fast.
    After this part you can dimension the array to pass to FileToArray... unless you want to read it yourself since you already have it open!
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How to find the number of entries in a master data table

    Hi Experts,
    I am trying to find the entries in 0CUSTOMER master data.
    BW>LISTCUBE>Data target: 0CUSTOMER and selected the fields that I need.
    I would like to know how to find the "number of entrees". I tried to run the SUM for a count field, but it is taking forever as there are huge number of records .

    Hi Dev,
    Go to the change/display mode of the info object (0CUSTOMER) in your case. Go to the Master data/Text tab. Here you will find the master data tables according to your settings (P orQ or X or Y). Double click on the table name and it will take you to the SE11 display. From there, you can check the number of records as you do in any transparent table.
    Hope this helps.
    Thanks and Regards
    Subray Hegde

  • How to find the number of links in a website

    hi every body
    can any one clear my doubt
    my doubt is that
    in a website how to find the number of links the hole website contains
    is there any navigation tool to find that
    plz help me yar
    i am waiting for the reply

    If you're talking about commercial sites (sites you don't have the source code for) I'm not sure.
    If you want to count the links in site that you have the source code for, it should be relatively easy to write a Java application to do it. All you really need to do is have a list of the files you want to count links in, read each file line by line and check for the existance of the <a> tag in each line. Anywhere their is an <a> tag there is a link.
    Hope this helps.

  • How to find the number of times method being called.....

    hi,
    can any one pls tell me how to find the number of times the method being called......herez the example....
    Refrence ref = new Refrence();
    for(int i = 0;i < arr.length; i++){
    if(somecondition){
    ref.getMethod();
    here i want to know how many times the getMethod() is calling...Is there any method to do this.. i have seen StrackTraceElement class..but not sure about that....pls tell me the solution....

    can any one pls tell me how to find the number of times the method being called......
    herez the example.... http://www.catb.org/~esr/faqs/smart-questions.html#writewell
    How To Ask Questions The Smart Way
    Eric Steven Raymond
    Rick Moen
    Write in clear, grammatical, correctly-spelled language
    We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding (often enough to bet on, anyway). Answering questions for careless and sloppy thinkers is not rewarding; we'd rather spend our time elsewhere.
    So expressing your question clearly and well is important. If you can't be bothered to do that, we can't be bothered to pay attention. Spend the extra effort to polish your language. It doesn't have to be stiff or formal ? in fact, hacker culture values informal, slangy and humorous language used with precision. But it has to be precise; there has to be some indication that you're thinking and paying attention.
    Spell, punctuate, and capitalize correctly. Don't confuse "its" with "it's", "loose" with "lose", or "discrete" with "discreet". Don't TYPE IN ALL CAPS; this is read as shouting and considered rude. (All-smalls is only slightly less annoying, as it's difficult to read. Alan Cox can get away with it, but you can't.)
    More generally, if you write like a semi-literate b o o b you will very likely be ignored. So don't use instant-messaging shortcuts. Spelling "you" as "u" makes you look like a semi-literate b o o b to save two entire keystrokes.

Maybe you are looking for