SQL limit and group rows

Hi,
I have two tables with 1 to n relationship.
StudentTable
==========
ID NAME
1 John
2 Mary
3 Peter
SubjectTable
=========
SID Subject
1 Maths
2 English
3 Science
The above two tables are connected with this table
StudentDetials
==========
ID(Students) SID(Subjects)
1 1
1 2
2 3
3 2
3 3
I want to select data from both tables. But I want to select only one row from SubjectTable for each student, even though there are many rows in SubjectTable for each student.
Is it possible to do this with SQL.
Best regards,
Chamal.

If you don't care about something specific about this SID's then may be this will help you a bit.
p.s. sorry it's a little rough, but I didn't want to create any tables :-)
select * from
(select id,sid,row_number() over (partition by id order by sid asc) rn
from (select 1 id,1 sid from dual
union all
select 1,2 from dual
union all
select 2,3 from dual
union all
select 3,2 from dual
union all
select 3,3 from dual) t)
where rn = 1;

Similar Messages

  • Page having PL/SQL process and Automatic Row Process for 2 different tables

    Hi,
    I have a page containing 2 regions A & B.
    Region-A content would be updated to table T1(PK : Ticket#).
    Region-B content would be inserted into table T2(PK: Attachment# ; FK: Ticket#).
    Region-B is used for uploading a file content into T2.
    Since I cannot use 2 DML processes on the page for 2 different tables with a common column, so I have a PL/SQL process to update the record into T1 and an Automatic Row Process(DML) for inserting into T2.
    Now the issue is in Region-B when I select a file using 'Browse' button and click on Upload button to fire the Automatic Row Process, the success message is displayed but the file is not uploaded into the table. But when I moved the entire Region-B and the Automatic Row Process to a different page and clicking Upload is working fine and inserting the record into the table along with the file content.
    An item P10_TICKET_NUMBER with source type as Database column with source value as TICKET_NUMBER is used in Region-A.
    I have gone through the forums and found some of the threads below
    Re: 2 Automated Row Processes for one page?
    Re: Error when trying to create 2 Forms on same page on 2 tables with ID as
    where people facing similar issues but here I have followed the solution provided(with one PL/SQL process and other Automatic process) in the threads but still issue persists.
    Can anyone throw some light on this please.
    Thanks,
    Raj.

    Hi Teku,
    You just have a look at this thread, where u can find a solution for your problem.
    INSERTING Records into Second table based on First table Primary Key
    hope this helps.
    Bye,
    Srikavi

  • Advanced datagrid with grouped columns and grouped rows

    hello every body, plz need your experience help. 'cause Im so new using FLEX
    I have an XML (like an XML data type) something like this
    <Table>
      <Rows>
        <cAgencia>F0002</cAgencia>
        <cAgNombre>SanBorja</cAgNombre>
        <cTVentanilla>V0002</cTVentanilla>
        <dTVNombre>Plataforma</dTVNombre>
        <TcksEnEspera>20</TcksEnEspera>
        <VentsEnAtencion>50</VentsEnAtencion>
      </Rows>
      <Rows>
         <cAgencia>F0003</cAgencia>
         <cAgNombre>Miraflores</cAgNombre>
         <cTVentanilla>V0002</cTVentanilla>
         <dTVNombre>Plataforma</dTVNombre>
         <TcksEnEspera>30</TcksEnEspera>
         <VentsEnAtencion>40</VentsEnAtencion>
       </Rows>
      <Rows>
         <cAgencia>F0002</cAgencia>
         <cAgNombre>SanBorja</cAgNombre>
         <cTVentanilla>V0003</cTVentanilla>
         <dTVNombre>Caja</dTVNombre>
         <TcksEnEspera>55</TcksEnEspera>
         <VentsEnAtencion>25</VentsEnAtencion>
       </Rows>
       ...... (continue)
    </Table>
    so, I need to make a table (I guess with advancedDataGrid) something like this
    as you can see,   I have to group them by columns and Rows.  I have found a "mx:groupedColumns" that maybe could help me , but I couldn't find something like "mx:groupedRows".
    The grid may be dynamic,   for example if I have another XML node like:
      <Rows>
         <cAgencia>F0004</cAgencia>
         <cAgNombre>SanMiguel</cAgNombre>
         <cTVentanilla>V0002</cTVentanilla>
         <dTVNombre>Plataforma</dTVNombre>
         <TcksEnEspera>15</TcksEnEspera>
         <VentsEnAtencion>52</VentsEnAtencion>
       </Rows>
    the grid may add a ROW and in the column of plataforma add the data: 15 and 52, so the grid may be something like this:
    as you can see, the grid may add rows and columns in depends of the count of XML data.
    plz help.
    thanks, regards  from Lima, Peru.
    JS

    any help ????????? I found OLAPDataGrid .....   I was thinking to send all the data into a bidimensional Array , then pass the data of my bidimensionalArray to  OLAPDataGrid ...  but I'n not sure if Flex is able to do it  .... 
    the really serious problem is the special ROW I must use ...
    regards
    JS

  • SQL to find grouped rows which have changed values?

    Hi,
    I am wondering if there is an efficient pure SQL way to do this...?
    I have a table that has a number of columns:
    InsertionDate
    Indentity
    Col-a to Col-z - some data.
    the pair (InsertionDate, Identity) are unique.
    The rows represent the same values as they change over time, for example:
    Select * from <mytable> order by Identity, InsertionDate;
    InsertionDate Identity Balance
    10-Feb-01 1001 -100
    11-Feb-01 1001 1
    12-Feb-01 1001 50
    10-Feb-01 1002 10
    11-Feb-01 1002 10
    12-Feb-01 1002 76
    I want to do the following:
    Select from <mytable> where InsertionDate and the next InsertionDate have a different value for Balance 'grouped by' Identity and InsertionDate = "10-Feb-01";
    [I use 'grouped by' very cautiously - I cannot explain in "pseudo sql"  without using the misleading grouped by term]
    To produce the output:
    InsertionDate Identity Balance
    10-Feb-01 1001 -100
    11-Feb-01 1001 1
    Select from <mytable> where InsertionDate and the next InsertionDate have a different value for Balance 'grouped by' Identity and InsertionDate = "11-Feb-01";
    InsertionDate Identity Balance
    11-Feb-01 1001 1
    12-Feb-01 1001 50
    11-Feb-01 1002 10
    12-Feb-01 1002 76
    There may be many columns in addition to Balance which also need to be checked for changes.
    Cheers,
    Karl.

    Hi, Karl,
    One way is to self-join two copies of the table, so you can compare any number of columns from adjacent rows.
    For example:
    WITH     got_r_num     AS
         SELECT     insertiondate, identity, balance
         ,     ROW_NUMBER () OVER ( PARTITION BY  identity
                                   ORDER BY          insertiondate
                           ) AS r_num
         FROM     mytable
    SELECT     a.insertiondate, a.identity, a.balance
    FROM     got_r_num      a
    JOIN     got_r_num      b     ON     a.identity     = b.identity
                         AND     a.r_num          IN ( b.r_num + 1
                                              , b.r_num - 1
    WHERE     a.balance     != b.balance
    AND     TO_DATE ( '11-Feb-2001'     -- Use a bind variable if you don't want to hard-code this parameter
              , 'DD-Mon-YYYY'
              ) = LEAST ( a.insertiondate
                         , b.insertiondate
    ORDER BY  identity
    ,            insertiondate
    ;Here, table a is the one to be displayed, and table b contains either the previous or the next row with the same identity.
    By the way, whenever you post a question, it really helps if you provide the sample data in a form that people can use to re-create the problem and test their solutions. CREATE TABLE and INSERT statements are best, for example:
    CREATE TABLE     mytable
    (      insertiondate     DATE
    ,      identity          NUMBER (4)
    ,      balance                 NUMBER
    INSERT INTO mytable (insertiondate, identity, balance) VALUES (TO_DATE ('10-Feb-2001', 'DD-Mon-YYYY'), 1001, -100);
    INSERT INTO mytable (insertiondate, identity, balance) VALUES (TO_DATE ('11-Feb-2001', 'DD-Mon-YYYY'), 1001, 1);
    INSERT INTO mytable (insertiondate, identity, balance) VALUES (TO_DATE ('12-Feb-2001', 'DD-Mon-YYYY'), 1001, 50);
    INSERT INTO mytable (insertiondate, identity, balance) VALUES (TO_DATE ('10-Feb-2001', 'DD-Mon-YYYY'), 1002, 10);
    INSERT INTO mytable (insertiondate, identity, balance) VALUES (TO_DATE ('11-Feb-2001', 'DD-Mon-YYYY'), 1002, 10);
    INSERT INTO mytable (insertiondate, identity, balance) VALUES (TO_DATE ('12-Feb-2001', 'DD-Mon-YYYY'), 1002, 76);
    COMMIT;I'm not sure what you mean by "There may be many columns in addition to Balance which also need to be checked for changes."
    Why not post an example that has 1 or 2 columns like balance, and the results you want for that.
    At first, this problem sounds like a job for the analytic LAG and/or LEAD functions, but depending on your answer to the last question, that may be very tedious: you'd need a separate function call (maybe even two) for each column, because a function can only return one value, but a join gets all the values at once.
    Edited by: Frank Kulash on Jun 11, 2010 10:43 AM

  • SQL SUM and Group By Function Wrong Result

    Hi All,
    I have a SQL view with all the payment transaction for a property per month and trying to sum all the transactions per month per property. For some months the total is not correct. For example for property 3856, in Jan 2014, the total should come to
    728 but the query lists 2184.
    Trans Date
              Amount
    Prop Code
    31/1/2014
    728          
    3856   
    31/1/2014
    -2184         
    3856   
    31/1/2014
    2184         
    3856   
    Output Required
    Year      Month   Amount     Prop Code
    2014        1          728              3856
    My Query
    Select [Prop Code], year(ttp.[Trans Date]) AS [Year], Month(ttp.[Trans Date]) AS [Month], SUM(ttp.[Payment Amount]) as Total
    FROM vw_tenant_payments as ttp
    GROUP BY [Prop Code], year(ttp.[Trans Date]), Month(ttp.[Trans Date])

    Hi All,
    I got it, it skipped my mind to restrict the payment type to RENT as even the deposit is in the transaction view
    Select
    [Prop Code],year(ttp.[Trans
    Date])AS[Year],Month(ttp.[Trans
    Date])AS[Month],SUM(ttp.[Payment
    Amount])asTotal
    FROM
    vw_tenant_payments
    asttp
    Where
    [Account Code]
    ='RENT'and[Prop
    Code] ='3856'
    GROUP
    BY[Prop
    Code],year(ttp.[Trans
    Date]),Month(ttp.[Trans
    Date])
    Order
    by[Prop
    Code],[Month]

  • SQL sentence and GROUP BY

    Hello:
    I have a table with the following facts: ID (autoincrement, primary key), item code, amount, value.
    I must select, FOR EACH item, the last ID (max value), the item code, and the division between value and amount just of the register with the MAX(ID).
    I think I must GROUP BY item, the dicision must appear in the sentence but not GROUPED BY anything.
    Something like this:
    SELECT max(ID), itemcode, value/amount
    FROM tablename
    GROUP BY itemcode
    FOR EXAMPLE, if I have the table
    1 Potatoes 2 1000
    2 Tomatoes 3 300
    3 Tomatoes 2 100
    4 Potatoes 1 4000
    The result should be
    3 Tomatoes 50
    4 Potatoes 4000
    Lots of thanks for your help and excuse me for my los level of SQL!

    Hello:
    I have a table with the following facts: ID
    (autoincrement, primary key), item code, amount,
    value.
    I must select, FOR EACH item, the last ID (max
    value), the item code, and the division between value
    and amount just of the register with the MAX(ID).
    I think I must GROUP BY item, the dicision must
    appear in the sentence but not GROUPED BY anything.
    Something like this:
    SELECT max(ID), itemcode, value/amount
    FROM tablename
    GROUP BY itemcode
    FOR EXAMPLE, if I have the table
    1 Potatoes 2 1000
    2 Tomatoes 3 300
    3 Tomatoes 2 100
    4 Potatoes 1 4000
    The result should be
    3 Tomatoes 50
    4 Potatoes 4000
    Lots of thanks for your help and excuse me for my los
    level of SQL!Your question is not clear. From the sample data and req o/p that you have given i think you want something like this:
    Maximum 2 IDs from a given set of data, their codes and a value => amount/value. Is that what you want?
    Jithendra

  • Sorting and Grouping -Two months in this query

    Hi All,
    many thanks for jeneesh
    i am doing project for construction company, i face this problem in grouping points according to relation between these points the
    Relation is from 1 to 100. If the point between this rang that mean there is relation between these points.
    this question already solve but the results not correct when the table has more data.
    SQL - sorting and grouping.
    from jeneesh and many thanks for him.
    This example for more clarifications
    for example i have these points
    id   location         percentage   comments
    1     loc 1,2          20%                that mean point  1 and 2 close to each other by 20%
    2     loc 1,3          40%              that mean point 1 and 3 close to each other byy 40%
    3     Loc 8,6          25%               that mean point 8 and 6 close to each other by 25%
    4     Loc  6,10        20%
    5     LOC 11,10        10 %
    6     LOC 15,14         0%Also , we can see the relation between these points as follwoing
    - points 1,2,3 in one group why becuase 1,2 has relation and 1,3 has relation that mean 1,3 also has hidden relation.
    - Points 6,8,10,11 in second group there are relations between them .
    - but no relation between 1 or 2 or 3 with any point of 6,8,9,10,11
    - as well as no relation between 15, 14 that mean 14 in third group and 15 in fourth group.
    whati need?
    to group the points that has relation according to percentage value ascending
    The most important part is to group the points. SO , the below query the gropuing is not correct.
    I have the follwoing table with data
    drop table temp_value;
    create table temp_value(id number(10),location varchar2(20), percentage number(9));
    insert into temp_value values  (1,'LOC 1,2',10);
    insert into  temp_value values (2,'LOC 1,3',0);
    insert into  temp_value values (3,'LOC 1,4',0);
    insert into  temp_value values (4,'LOC 1,5',0);
    insert into  temp_value values (5,'LOC 1,6',0);
    insert into  temp_value values (6,'LOC 2,3',0);
    insert into  temp_value  values(7,'LOC 2,4',0);
    insert into  temp_value values (8,'LOC 2,5',30);
    insert into  temp_value values (9,'LOC 2,6',0);
    insert into  temp_value values (10,'LOC 3,4',0);
    insert into  temp_value values (11,'LOC 3,5',0);
    insert into  temp_value values (12,'LOC 4,5',40);
    insert into  temp_value values (13,'LOC 4,6',0);
    insert into  temp_value values (14,'LOC 6,7',40);
    insert into  temp_value values (15,'LOC 7,2',0);
    insert into  temp_value values (16,'LOC 8,2',60);
    insert into  temp_value values (17,'LOC 8,3',0);
    insert into  temp_value values (18,'LOC 3,1',0);
    insert into  temp_value values (19,'LOC 9,6',30);
    insert into  temp_value values (20,'LOC 11,2',0);
    insert into  temp_value values (22,'LOC 12,3',10);
    insert into  temp_value values (23,'LOC 19,3',0);
    insert into  temp_value values (24,'LOC 17,3',0);
    insert into  temp_value values (24,'LOC 20,3',0);when i used this query , the results is not correct
    with t as
        (select percentage,loc1,loc2,sum(case when percentage = 0 then 1
                           when loc1 in (l1,l2) then 0
                       when loc2 in (l1,l2) then 0
                       when l1 is null and l2 is null then 0
                       else 1
                  end) over(order by rn) sm
        from (     select id,location,percentage,
                           regexp_substr(location,'\d+',1,1) LOC1,
                          regexp_substr(location,'\d+',1,2)  LOC2,
                         lag(regexp_substr(location,'\d+',1,1))
                          over(order by percentage desc) l1,
                          lag(regexp_substr(location,'\d+',1,2))
                          over(order by percentage desc) l2,
                  row_number() over(order by percentage desc) rn
          from temp_value
          order by percentage desc
       select loc,min(sm)+1 grp
         from(
           select loc,rownum rn,sm
           from(
           select percentage,decode(rn,1,loc1,loc2) loc,sm
           from t a,
                (select 1 rn from dual union all
                 select 2 from dual ) b
           order by percentage desc,decode(rn,1,loc1,loc2) asc
        group by loc
       order by min(sm),min(rn);the results
    SQL> /
    LOC                         GRP
    2                             1
    8                             1
    6                             2
    7                             2
    4                             3
    5                             3
    9                             4
    1                             5
    12                            6
    3                             6
    11                           13
    LOC                         GRP
    19                           14
    17                           15
    20                           22
    14 rows selected.SQL>
    but the correct is
    Location        group No
    2                  1
    8                  1
    4                  1
    5                  1
    1                  1
    6                  2
    7                  2
    9                  2
    12                 3
    3                  3
    19                 4
    17                 5
    20                 6many thanks in advance.
    Edited by: Ayham on Nov 30, 2012 3:07 AM

    Thanks,
    i want the sorting for each group DESC not all groups to gather
    when i used your query i get
    SQL> with connects as (
      2  select distinct
      3   loc1
      4  ,loc2
      5  ,dense_rank() over (order by connect_by_root(loc1)) grp
      6  from temp_value
      7  start with
      8  percentage != 0
      9  connect by nocycle
    10  (prior loc2 = loc1
    11  or
    12  prior loc1 = loc2
    13  or
    14  prior loc1 = loc1
    15  or
    16  prior loc2 = loc2)
    17  and
    18  percentage != 0
    19  )
    20  ,  got_grp AS
    21  (
    22     select
    23      loc
    24      ,dense_rank() over (order by grp) grp
    25      from (
    26      select
    27       loc
    28       ,max(grp) keep (dense_rank first order by grp) grp
    29       from (
    30       select
    31        loc1 loc
    32        ,grp
    33        from connects
    34        union
    35        select
    36         loc2
    37         ,grp
    38         from connects
    39         )
    40         group by
    41         loc
    42        )
    43  )
    44  SELECT       loc
    45  ,    grp
    46  FROM         got_grp
    47  ORDER BY  COUNT (*) OVER (PARTITION BY grp)   DESC
    48  ,            grp
    49  ,    loc
    50  ;The output is
    LOC                         GRP
    1                             1
    2                             1
    4                             1
    5                             1
    8                             1
    6                             3
    7                             3
    9                             3
    12                            2
    3                             2
    10 rows selected.but i want it like this
    Loc  Grp
    2      1
    8      1
    4      1
    5      1
    1      1
    12    2
    3      2
    6      3
    7      3
    9      3So , the sorting for each group Separate based on the percentage column.
    many thanks
    Edited by: Ayham on Nov 30, 2012 9:43 AM

  • Using member sorting and grouping with two reports sharing rows

    Hi!
    I have a problem with one report and I need some help or advise here.
    I have two dimensions with dynamic expansion in rows (PRODUCT, MATERIAL), and I use the option Member Sorting and Grouping at Member selector to obtain the total amount of PRODUCT group by PARENTH1:
    PRODUCT               MATERIAL          AMOUNT
    TOTAL PROD_A-X                                   100
    PROD_A_A             MAT1                          22
    PROD_A_B             MAT1                          50
    PROD_A_A             MAT2                          28 
    TOTAL PROD_B-X                                   120
    PROD_B_A             MAT1                          30
    PROD_B_A             MAT2                          50
    PROD_B_B             MAT2                          40
    This works fine if I only have one report, but I need to create another one sharing the row and page axis with the Default Report, when I do that the option Member Sorting and Grouping doesn't work. I really need to have two reports with shared rows and also the summation by PARENTH1, how can I do that?
    Thank you very much

    Hi!
    I have a problem with one report and I need some help or advise here.
    I have two dimensions with dynamic expansion in rows (PRODUCT, MATERIAL), and I use the option Member Sorting and Grouping at Member selector to obtain the total amount of PRODUCT group by PARENTH1:
    PRODUCT               MATERIAL          AMOUNT
    TOTAL PROD_A-X                                   100
    PROD_A_A             MAT1                          22
    PROD_A_B             MAT1                          50
    PROD_A_A             MAT2                          28 
    TOTAL PROD_B-X                                   120
    PROD_B_A             MAT1                          30
    PROD_B_A             MAT2                          50
    PROD_B_B             MAT2                          40
    This works fine if I only have one report, but I need to create another one sharing the row and page axis with the Default Report, when I do that the option Member Sorting and Grouping doesn't work. I really need to have two reports with shared rows and also the summation by PARENTH1, how can I do that?
    Thank you very much

  • How to Perform Forced Manual Failover of Availability Group (SQL Server) and WSFC (Windows Server Failover Cluster)

    I have a scenario with the three nodes with server 2012 standard, each running an instance of SQL Server 2012 enterprise, participate in a
    single Windows Server Failover Cluster (WSFC) that spans two data centers.
    If the nodes in the primary data center are unavailable due to data center outage. Then how I can able to access node in the WSFC (Windows Server Failover Cluster) in the secondary disaster recovery data center automatically with some script.
    I want to write script that can be able to check primary data center by pinging some IP after every 5 or 10 minutes.
    If that IP is unable to respond then script can be able to Perform Forced Manual Failover of Availability Group (SQL Server) and WSFC (Windows Server Failover Cluster)
    Can you please guide me for script writing for automatic failover in case of primary datacenter outage?

    please post you question on failover clusters in the cluster forum.  THey will explain how this works and point you at scipts.
    You should also look in the Gallery for cluster management scripts.
    ¯\_(ツ)_/¯

  • How to Perform Forced Manual Failover of Availability Group (SQL Server) and WSFC (Windows Server Failover Cluster) with scrpiting

    I have a scenario with the three nodes with server 2012 standard, each running an instance of SQL Server 2012 enterprise, participate in a
    single Windows Server Failover Cluster (WSFC) that spans two data centers.
    If the nodes in the primary data center are unavailable due to data center outage. Then how I can able to access node in the WSFC (Windows Server Failover Cluster) in the secondary disaster recovery data center automatically with some script.
    I want to write script that can be able to check primary data center by pinging some IP after every 5 or 10 minutes.
    If that IP is unable to respond then script can be able to Perform Forced Manual Failover of Availability Group (SQL Server) and WSFC (Windows Server Failover Cluster)
    Can you please guide me for script writing for automatic failover in case of primary datacenter outage?

    You are trying to implement manually what should be happening automatically in the cluster. If the primary SQL Server becomes unavailable in the data center, it should fail over to the secondary SQL Server automatically.  Is that not working?
    You also might want to run this configuration by some SQL experts.  I am not a SQL expert, but if you have both hosts in the data center in a cluster, there is no need for replication between those two nodes as they would be accessing
    the database from some form of shared storage.  Then it looks like you are trying to implement Always On to the DR site.  I'm not sure you can mix both types of failover in a single configuration.
    FYI, it would make more sense to establish a file share witness in your DR site instead of placing a third node in the data center for Node Majority quorum.
    . : | : . : | : . tim

  • Count number of rows from oracle and sql database and generate a report

    Hi All,
    Can someone help me in writing a java program for the following scenario?
    1. Read the number of rows available from oracle table and print the total row count in a Report.txt text file.
    2. Read the number of rows inserted in a sql database (after a specific process-just an information) and print the total row count in the same text file Report.txt .
    3. Read the Error Log file (which is generated after a specific process say it has success and failed report for each iterations) and print the number of success and number of failure in the same text file Report.txt .
    I need the final Report.txt file in the following format:
    1. Oracle table <table name> has 500000 rows.
    2. After completion of the specific process 300000 rows were added to SQL table <table name>
    Error Log Report:
    300000 successfull entries and 200000 failed entries were found from the Error Log file.

    Thanks for your immediate reply.
    I'm just a beginner in java so if i make any mistake please correct and excuse me. :)
    This is the code i have for connecting to two different database.
    package connectDatabase;
    * @author
    import java.sql.*;
    public class ConnectTo
         public void OracleDB()
              Connection dbconn;
              try {
                DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                String connString="jdbc:oracle:thin:@SYS_IP:1521:oracl";
                dbconn = DriverManager.getConnection(connString, "uname","pwd" );
            catch(SQLException sqlex)
                 sqlex.printStackTrace();
            catch(Exception excp)
                excp.printStackTrace();
         public void SqlDB()
              Connection conn;
              try { 
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); 
                String url = "jdbc:odbc:connectDB"; 
                conn = DriverManager.getConnection(url,"uname","pwd");  
              catch (Exception e)
                System.err.println("An Exception occured! " +e.getMessage()); 
    }I'm just codding the second half which is for connecting to oracle databse and calculates the row count and displayes in the command prompt.
    then connects to SQL database and counts successfull insert in the table.(row count) and displayes on the command prompt.
    can you simplify the above code so that i can call the oracleDB() method and SqlDB() method seperately from another calss file using the object of this class?
    I'm ok if the report can be seen in a command prompt. FInally i need to calculate the success and failure count from the log file. will let you know once i'm done with codding.

  • Group rows together and toggle / collapse them

    I'm trying to leave excel, but one thing I can't figure out is how to group rows together so i can collapse or expand them. I realize there are categories, but they won't work for me for a variety of reasons. What I simply want to do is take a few rows and group them with the main top row and be able to click to show/hide the subrows. that's simple. i want to do it manually for just some rows, not an entire table. i find category groups confusing and irritating, and they're not working correctly.
    How can I do this in numbers?

    Make sure that the input for the Sub Mix track says Bus 1.

  • What is meant by estimated costs and estimated rows in SQL explain (ST05)?

    Hi
    I was just wondering if someone could explain/clarify exactly what is meant by estimated costs and estimated rows in the 'explain' / execution path functionality of ST05.
    For example, we could see a SQL statement was very inefficient accessing a table:
    Estimated Costs = 6.006.615 , Estimated #Rows = 0
    Does this literally mean that for 6 million costs / reads / effort, 0 results were returned??
    Is this a ratio of efficiency?
    We built an appropriate index and now we have:
    Estimated Costs = 2 , Estimated #Rows = 1
    A lot better! The job was taking 40+ hours and being cancelled; now it takes 5 minutes. So a 3 million times improvement sounds realistic...
    However, we had another instance where the explain showed:
    ( Estim. Costs = 195.077 , Estim. #Rows = 538.660 )
    and we built an index, and now the explain is:
    ( Estimated Costs = 41.867 , Estimated #Rows = 538.660 )
    What exactly does this mean - as the costs has been reduced, but the rows is the same?
    Thanks
    Ross

    Hi Ross,
    >I was just wondering if someone could explain/clarify exactly what is meant by estimated costs and estimated rows in the >'explain' / execution path functionality of ST05
    Take a look at note 766349, point 20.
    >An EXPLAIN displays "Estimated Costs" and "Estimated Rows", which
    >are simply the CBO's calculation results (refer to Note 7550631).
    >Since these results are based upon a number of assumptions (column
    >values are distributed equally, statistics), and depend upon the
    >database parameter settings, the calculated costs and rows are
    >useful only within a margin for error. High "Estimated Costs" and
    >"Estimated Rows" are therefore neither a satisfactory nor a
    >necessary indication of an expensive SQL statement. Also, the
    >calculated costs have no actual effect upon the performance - the
    >deciding costs are always the actual ones, in the form of BUFFER
    >GETs, DISK READs, or processed rows.
    So the costs and rows are values conjured up by the cost optimizer when calculating the access path that is most likely to be efficient. THEY ARE ESTIMATES!!!
    >Does this literally mean that for 6 million costs / reads / effort, 0 results were returned??
    As per the above, no. The costs and rows are estimated before the rows are fetched so there are no actual results yet.
    >What exactly does this mean - as the costs has been reduced, but the rows is the same?
    An efficient database access is exactly that; reads only the blocks that contain the rows it needs and nothing else. If the access is inefficient it will spend time accessing blocks that contain no data that is eventually contained in the result set.
    This question would be better placed in the Oracle forum...
    Regards,
    Peter

  • Known limit for how many characters can be entered in the To field when adding People and Groups ?

    I am running MOSS 2007 SP1. I browse to site settings > People and groups and a group which has more than 60 members. I select all > Click Actions > Email Users. Nothing happens. I select less users, new outlook window comes up as it should. I am running outlook 2007. I first thought that the limit was 50 users, but different user selections let me select 51 users as well. I then concentrated on the character limit and I noticed that there were about 1580 characters in the To field when I selected 50/51 users.
    Is there a known limit in sharepoint/outlook client for this function on how many characters can be entered in the To field?

    Hello Amar,
    This is a by-design behavior, not from SharePoint side, but Internet Explorer. The limitation by the 2083 characters in IE for the Max URL length is described in the following KB article:
    (KB208427) Maximum URL length is 2,083 characters in Internet Explorer
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;208427
    As a workaround, you may need to divide the list up and not send all the email at the same time. Hope it helps!
    Best Regards,
    Lionel

  • SCOM 2012 R2 Management Servers and SQL Server Availability Groups

    My team is in the middle of rolling out a brand new install of System Center Operations Manager 2012 R2.
    I have set up a SQL Server Availability group that is spread across multiple subnets and installed the initial management server per
    here. 
    As I have gone through attaching new management servers, I have noticed disturbing behavior.  When the AG fails over to another node, the management servers will lose connectivity unless I either recycle the service or it fails back to the original
    node.  This is not a security issue as I have set up permissions.  It says it cannot connect to the database anymore at all.
    Has anyone else seen this behavior?  Is there a setting I am missing somewhere?
    Thanks for your help.
    Dale

    Hi Dale,
    What about ApplicationIntent\Readonly?
    http://msdn.microsoft.com/en-us/library/hh205662(v=vs.110).aspx
    Still thinking about DNS, may be this could be for your case:
    http://www.sqlservercentral.com/Forums/Topic1449216-2799-1.aspx
    Natalya

Maybe you are looking for