Count an id in several tables

I have a table ( table1 ) with an id. I need to know how many times this id appears in three other tables. I have created a set of sql statements that demonstrate the problem.
I have a query that works, but I imagine there must be a better way.
<snip>
-- create testing tables
CREATE TABLE TABLE1 (
TABLE1_ID NUMBER(3));
CREATE TABLE TABLE2 (
TABLE2_ID NUMBER(3),
TABLE1_ID NUMBER(3));
CREATE TABLE TABLE3 (
TABLE3_ID NUMBER(3),
TABLE1_ID NUMBER(3));
CREATE TABLE TABLE4 (
TABLE4_ID NUMBER(3),
TABLE1_ID NUMBER(3));
-- insert testing data
INSERT INTO TABLE1 VALUES (100);
INSERT INTO TABLE2 VALUES (200,100);
INSERT INTO TABLE2 VALUES (201,100);
INSERT INTO TABLE3 VALUES (300,100);
INSERT INTO TABLE3 VALUES (301,100);
INSERT INTO TABLE3 VALUES (302,100);
INSERT INTO TABLE4 VALUES (400,100);
INSERT INTO TABLE4 VALUES (401,100);
INSERT INTO TABLE4 VALUES (402,100);
INSERT INTO TABLE4 VALUES (403,100);
-- functional but ugly query
SELECT C.TABLE2_COUNT,
D.TABLE3_COUNT,E.TABLE4_COUNT
FROM (SELECT COUNT(B.TABLE1_ID) TABLE2_COUNT
FROM TABLE1 A,TABLE2 B
WHERE A.TABLE1_ID=B.TABLE1_ID) C,
(SELECT COUNT(B.TABLE1_ID) TABLE3_COUNT
FROM TABLE1 A,TABLE3 B
WHERE A.TABLE1_ID=B.TABLE1_ID) D,
(SELECT COUNT(B.TABLE1_ID) TABLE4_COUNT
FROM TABLE1 A,TABLE4 B
WHERE A.TABLE1_ID=B.TABLE1_ID) E;
-- clean up
DROP TABLE TABLE1;
DROP TABLE TABLE2;
DROP TABLE TABLE3;
DROP TABLE TABLE4;
</snip>
Any help or advice are greatly appreciated.
Thank you.
S

Hi,
Tubby wrote:
This should be less resource intensive than the original.
select
(select count(*) from table2 t2 where t1.TABLE1_ID = t2.TABLE1_ID) as table2_count,
(select count(*) from table3 t3 where t1.TABLE1_ID = t3.TABLE1_ID) as table3_count,  
(select count(*) from table4 t4 where t1.TABLE1_ID = t4.TABLE1_ID) as table4_count 
from table1 t1
That produces one row of oputput for every row in table1.
If table1 can have more than one row, do this:
SELECT     SUM ((SELECT COUNT(*) FROM table2 WHERE table1_id = a.table1_id))     AS table2_count
,     SUM ((SELECT COUNT(*) FROM table3 WHERE table1_id = a.table1_id))     AS table3_count
,     SUM ((SELECT COUNT(*) FROM table4 WHERE table1_id = a.table1_id))     AS table4_count
FROM     table1     a
;

Similar Messages

  • Creating a combined timeline based on several timelines in several tables

    Hi,
    I need to extract a timeline for a customer based on valid_from and valid_to dates in several tables.
    For example: I have a table named customers with an id, a valid_from and a valid_to date and a table named contracts with an contrat_name, customer_id and valid_from and valid_to:
    CUSTOMERS:
    ID | VALID_FROM | VALID_TO
    1 | 01.03.2010 | 01.01.4000
    CONTRACTS:
    CONTRACT_NAME | CUSTOMER_ID | VALID_FROM | VALID_TO
    ContractA | 1 | 01.03.2010 | 01.10.2010
    ContractB | 1 | 01.10.2010 | 01.01.4000
    The following statement would now give me the correct timeline:
    select cus.id customer, con.contract_name contract, greatest(cus.valid_from,con.valid_from) valid_from, least(cus.valid_to,con.valid_to) valid_to
    from customers cus
    inner join contracts con on cus.id = con.customer_id;
    CUSTOMER | CONTRACT | VALID_FROM | VALID_TO
    1 | ContractA | 01.03.2010 | 01.10.2010
    1 | ContractB | 01.10.2010 | 01.01.4000
    That works, but I get a problem as soon as I have a point of time where there is no contract for a customer but I still would like to have these periods in my timeline:
    Let's assume the following data and the same select statement:
    CUSTOMERS:
    ID | VALID_FROM | VALID_TO
    1 | 01.03.2010 | 01.01.4000
    CONTRACTS:
    CONTRACT_NAME | CUSTOMER_ID | VALID_FROM | VALID_TO
    ContractA | 1 | 01.05.2010 | 01.10.2010
    ContractB | 1 | 01.12.2010 | 01.03.2011
    What I would now get would be:
    CUSTOMER | CONTRACT | VALID_FROM | VALID_TO
    1 | ContractA | 01.05.2010 | 01.10.2010
    1 | ContractB | 01.12.2010 | 01.03.2011
    But what I would like to get is the following:
    CUSTOMER | CONTRACT | VALID_FROM | VALID_TO
    1 | null | 01.03.2010 | 01.05.2010
    1 | ContractA | 01.05.2010 | 01.10.2010
    1 | null | 01.10.2010 | 01.12.2010
    1 | ContractB | 01.12.2010 | 01.03.2011
    1 | null | 01.03.2011 | 01.01.4000
    What I do not want to do is to generate a result with contract = null any time there is no contract since I actually want to join the timeline of several different tables into one and it would therefore become very complicated to assume things based on what data can or can not be found in one specific table.
    Thanks for any help or ideas,
    Regards,
    Thomas

    Hi, Thomas,
    Thomas Schenkeli wrote:
    ... Is this the way you meant? Because I actually didn't have to change anything about part (b) of the statement since non-matching results were excluded by the where-clause "OR     valid_from     < valid_to" in the final select anyway.You're absolutely right. Sorry about the mistakes in my last message. I'm glad you solved the problem anyway.
    Beware of SELECT DISTINCT . Adding DISTINCT causes the system to do extra work, often because the query was doing something wrong and generating too many rows, so you pay for it twice. In this case, the join conditions in (b) are different from (a) and (c), so b is generating too many rows. The DISTINCT in the main query corrects that mistake, but it would be more efficient just to avoid the mikstake in the first place, and use the same join conditions in all 3 branches of the UNION. (You could also factor out the join, doing it once in another sub-query, and then referencing that result set in each branch of the UNION.)
    You can get the same results a little more efficiently, with a little less code, this way:
    WITH     union_data     AS
         SELECT       MIN (ua.customer_id)     AS customer_id
         ,       NULL               AS contract_name
         ,       MIN (ua.valid_from)     AS valid_from
         ,       MIN (oa.valid_from)     AS valid_to
         ,       'A'                AS origin
         FROM       tmp_customers     ua
         JOIN       tmp_contracts     oa     ON     oa.customer_id     = ua.customer_id
                               AND     oa.valid_from     >= ua.valid_from
                             AND     oa.valid_to     <= ua.valid_to
         GROUP BY  ua.id
        UNION ALL
         SELECT       ub.customer_id
         ,       ob.contract_name
         ,       ob.valid_from
         ,       ob.valid_to
         ,       'B'                AS origin
         FROM       tmp_customers     ub
         JOIN       tmp_contracts     ob     ON     ob.customer_id     = ub.customer_id
                               AND     ob.valid_from     >= ub.valid_from
                             AND     ob.valid_to     <= ub.valid_to
        UNION ALL
         SELECT       uc.customer_id
         ,       NULL               AS contract_name
         ,       oc.valid_to          AS valid_from
         ,       LEAD ( oc.valid_from
                     , 1
                     , uc.valid_to
                     ) OVER ( PARTITION BY  uc.id
                        ORDER BY      oc.valid_from
                         )          AS valid_to
         ,       'C'                AS origin
         FROM       tmp_customers     uc
         JOIN       tmp_contracts     oc     ON     oc.customer_id     = uc.customer_id
                               AND     oc.valid_from     >= uc.valid_from
                             AND     oc.valid_to     <= uc.valid_to
    SELECT       *
    FROM       union_data
    WHERE       contract_name     IS NOT NULL
    OR       valid_from     < valid_to
    ORDER BY  customer_id
    ,       valid_from
    You may have noticed that this site normally doesn't display multiple spaces in a row.
    Whenever you post formatted text on this site, type these 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Count of rows of a table in header

    Hi Experts,
    I am stuck in a tricky scenario.
    I need to get the count of rows of a table in a webi report in the header of the report.
    And the count should change dynamically according to the filtering done on the table.
    For eg.
    If I have 10 countries in a table, so table has 10 rows.
    Now the count on header should show 10.
    Now if we filter the column to 5 countries, the count on the header should change to 5.
    Any Idea's.
    Regards,
    Gaurav

    Nops
    It doesn't work.
    Let me reframe my issue again:
    I dragged country object on my report.
    UK
    US
    JAPAN
    CANADA
    Now lets say in the report title, I write the formula as =Count(country)
    It will give me 4.
    Now I clicked on the column country and applied filter i.e. country = US ; UK
    Now the block shows
    UK
    US
    In the header the cell still shows 4, which I want to see as 2.
    Any ideas....?
    Thanks
    Gaurav

  • How to get count of rows for a table?

    Hi,
    How to get count of rows for a table and secondly, how can i have access to a particular cell in a table?
    Regards,
    Devashish

    Hi Devashish,
    WdContext.node<Your_node_name>().size() will give you the no: of rows.
    This should be the node that is bound to the table's datasource property.
    WdContext.node<Your_node_name>().get<node_name>ElementAt(index_value); will select the row at that particular index.
    You can access an attribute of a particular row as
    WdContext.node<Your_node_name>().get<node_name>ElementAt(index_value).get<attribute_name>();
    Hope this helps,
    Best Regards,
    Nibu.
    Message was edited by: Nibu Wilson

  • Displaying several tables with same structure

    There are several tables with the same structure (number of columns, column names, column types etc.) and corresponding ADF BC view objects.
    A user should interactively choose the table he or she wants to edit. The UI remains the same for any given table.
    I need advice on how to implement this optimally, considering ease of development and performance.
    Right now I'm planning to use a SelectOneListbox for choosing and hide and show some containers with tables and forms for editing.
    I feel it should be quite easy, but I am an ADF newbie and feel puzzled :)
    Thanks in advance for any help!

    Hi,
    I feel your approuch will work fine . Check if following link can help
    http://www.oracle.com/technology/products/adf/patterns/11/enabledisablepattern.pdf
    Vikram

  • How to return in pl/sql the tuples of an sql query comming  several tables

    I have a select query whose result comes from several tables. The question is how to return the tuples of the select query using a pl/sql function. In othe words, is it possible to define a construct structure to store the values of sql query and return that construct. if yes how to define such a construct where its elements comming from several tables.
    I appreciate very much ur help

    The way to return a resultset from a function is with a cursor variable. The lazy of doing this is using a weakly-typed ref cursor (in 9i use the predefined SYS_REFCURSOR).
    Cheers, APC

  • How to count number of rows in table

    can I get number of row in table except Count(*) in pl/sql
    is there any other way

    Also posted and answered here
    how to count number of rows in table
    count(*) will be the fastest way. It is only slow if the table has a vast number of rows, in which case why do you need to know the tables has 73552436467721 rows and not 73552436467737 rows. It doesn't seem to be much use. Either that or you are counting them a lot, which again seems rather pointless.

  • The biggest count of rows of sys tables

    Hii ??
    I want to learn how can I find the biggest count of rows of sys tables or
    which table has around 900000 records on sys user database oracle 10g??

    Hello;
    What purpose would knowing the row count in tables owned by SYS serve ? The query below will give you a fair idea of row counts in tables owned by SYS assuming that statistics have been recently gathered for these tablesselect table_name,num_rows from dba_tables where owner='SYS';Varad

  • Strange behaviour of view based on several tables join with union all

    Dear fellows we r facing a strange problem we have a view based on several tables joined by union all ,when we issue an ordered query on date,rows returned are unusually different than they should be .
    Is oracle has some special behaviour for view based on union all ?
    I m using oracle 8.1.6 on windows 2000
    Kashif Sohail

    Did you ever solve this problem? I have two select statements based on 4 tables and 3 views using about 5 more tables. When I execute each select individually I get exactly what is expected. When I UNION ALL both selects together, I get "no rows returned", however when I UNION them I get exactly what is expected. I should get the same answer for both UNION ALL and UNION. The two select statements are identical, except for one column where I changed the constant to be different. Any thoughts?

  • Count rows in an internal table

    Anybody how knows how I can count rows in my internal table?

    Hi,
    Data: lines like sy-tabix.
    DESCRIBE TABLE ITAB LINES LINES.
    where itab is your internal table.
    This will work out.
    Please award sutiable points .
    Regards,
    Irfan

  • Several tables in a single datafile

    Hi,
    Is possible to load several different tables through a single datafile , then I can choose where to start and finish the load of each table independently or the correct way is to separate the datafile in several datafiles.
    So far i have not found the solution in sql loader.

    Thanks, but the demo example isn`t exactly my problem. I say that the datafile contains several tables and not one table as in the example,using only the WHEN keyword, i can´t or i don´t know solve it.
    Little sample of datafile:
    time received delivered deferred bounced rejected
    0000-0100 203 264 0 0 458
    0100-0200 99 141 0 0 552
    0200-0300 97 162 0 0 511
    0300-0400 204 449 0 1 541
    0400-0500 104 139 0 0 441
    0500-0600 164 198 0 0 546
    msg cnt bytes
    305 160522k
    206 89944k
    147 101234k

  • After Client copy several tables were cleared.

    Good night!
    After making a client copy 400 to the client 250 in my environment of DEV Netwaver ECC 6.0 Oracle 10.2.0.2 several tables were cleared.
    Example:
    4 ETA346 "CABN             :""       0        0        0 DEL.""       0        0   16:45:01"
    Is there any way to transfer the data tables of the environment of QAS for the tables of environmental DEV that were cleared?
    Someone could tell me why the tables were cleared?
    Is there any way to restore the environment of DEV?
    Thank
    Pamplona
    log:
    1 ETA028XClient copy from "12.08.2008" "15:25:32"
    1 ETA029 System ID............................ "DEV"
    1 ETA043 Target client........................ "250"
    1 ETA030 R/3 Release.......................... "700"
    1 ETA354   Basis Support Package..............."SAPKB70014"
    1 ETA031 Host................................. "srvdevnw"
    1 ETA000 Start in background............. ....."X"
    1 ETA032 User................................. "SAP*"
    1 ETA033 Parameter
    1 ETA034 Source client........................ "400"
    1 ETA188 Source client user masters............"400"
    1 ETA185 Copier profile:......................."SAP_UCSV"
    1 ETA036 Table selection
    1 ETA177 Customizing data ....................."X"
    1 ETA037 With application data................ " "
    1 ETA155 Initialize and recreate......... "X"
    2 ETA367XStart analysis of system "15:25:32"
    3 ETA108 "/GC1/CC_EXIT_CLIENT_DELETION" executed "        0"("        0") entries copied
    4 ETA114 Runtime "             0" seconds
    3 ETA072 Exit program "/GC1/CC_EXIT_CLIENT_DELETION" successfully executed "15:25:54"
    A3 E/SAPCND/CUST_T 010 Start of exit "/SAPCND/CC_COND_TABLE_MATCH"
    A4 E/SAPCND/CUST_T 011 Exit "/SAPCND/CC_COND_TABLE_MATCH" is not executed in case MODUS = "C"
    3 ETA108 "/SAPCND/CC_COND_TABLE_MATCH" executed "        0"("        0") entries copied
    4 ETA114 Runtime "             0" seconds
    3 ETA072 Exit program "/SAPCND/CC_COND_TABLE_MATCH" successfully executed "15:25:55"
    A3 E/SAPCND/CUST_T 007XRemote Client Copy/ Client Export exit called in source system -> Return
    3 ETA108 "/SAPCND/CC_GROUP_WS_AA" executed "        0"("        0") entries copied
    4 ETA114 Runtime "             0" seconds
    3 ETA072 Exit program "/SAPCND/CC_GROUP_WS_AA" successfully executed "15:25:55"
    A3 E/SAPCND/CUST_T 010 Start of exit "/SAPCND/CC_INCLUDE_TABLES"
    A4 E/SAPCND/CUST_T 008 Condition Table "/1CN/CPNSAP00001" is not relevant for appl (= application data) = " "
    A4 E/SAPCND/CUST_T 008 Condition Table "/1CN/CPASAP00001" is not relevant for appl (= application data) = " "
    A4 E/SAPCND/CUST_T 008 Condition Table "/1CN/CPTSAP00001" is not relevant for appl (= application data) = " "
    A4 E/SAPCND/CUST_T 008 Condition Table "/1CN/CPTSAP00004" is not relevant for appl (= application data) = " "
    A4 E/SAPCND/CUST_T 008 Condition Table "/1CN/CPTSAP00005" is not relevant for appl (= application data) = " "
    A4 E/SAPCND/CUST_T 008 Condition Table "/1CN/CPTSAP00006" is not relevant for appl (= application data) = " "
    A4 E/SAPCND/CUST_T 008 Condition Table "/1CN/CRMSAP_CARR" is not relevant for appl (= application data) = " "
    A4 E/SAPCND/CUST_T 008 Condition Table "/1CN/CRMSAP_CONN" is not relevant for appl (= application data) = " "
    A4 E/SAPCND/CUST_T 008 Condition Table "/1CN/CRMSAP_PART" is not relevant for appl (= application data) = " "
    A4 E/SAPCND/CUST_T 008 Condition Table "/1CN/CTXSAPRIN03" is not relevant for appl (= application data) = " "
    A4 E/SAPCND/CUST_T 008 Condition Table "/1CN/CTXSAPRIN04" is not relevant for appl (= application data) = " "
    A4 E/SAPCND/CUST_T 008 Condition Table "/1CN/CTXSAPRIN07" is not relevant for appl (= application data) = " "
    A4 E/SAPCND/CUST_T 008 Condition Table "/1CN/CTXSAPX0101" is not relevant for appl (= application data) = " "
    A4 E/SAPCND/CUST_T 008 Condition Table "/1CN/CTXSAPX0103" is not relevant for appl (= application data) = " "
    A3 E/SAPCND/CUST_T 013 End of exit "/SAPCND/CC_INCLUDE_TABLES"
    3 ETA108 "/SAPCND/CC_INCLUDE_TABLES" executed "       98"("        0") entries copied
    4 ETA114 Runtime "             2" seconds
    3 ETA072 Exit program "/SAPCND/CC_INCLUDE_TABLES" successfully executed "15:25:57"
    3 ETA108 "ADDR_CLIENTCOPY_SELECT_TABLES" executed "       26"("        0") entries copied
    4 ETA114 Runtime "             0" seconds
    3 ETA072 Exit program "ADDR_CLIENTCOPY_SELECT_TABLES" successfully executed "15:26:00"
    3 ETA108 "EFG_FORM_CC_EXIT_BEFORE" executed "        0"("        0") entries copied
    4 ETA114 Runtime "             1" seconds
    3 ETA072 Exit program "EFG_FORM_CC_EXIT_BEFORE" successfully executed "15:26:03"
    A3 EFINB_TR 070XStart of deletion methods for client "250"
    A4 EFINB_TR 061 Start the deletion method for object "FINB-TR-DERIVATION"
    A4 EFINB_TR 062 End of deletion method of object "FINB-TR-DERIVATION"
    A4 EFINB_TR 061 Start the deletion method for object "UCM003"
    A4 EFINB_TR 062 End of deletion method of object "UCM003"
    A4 EFINB_TR 061 Start the deletion method for object "/EACC/ARCHIVING"
    A4 EFINB_TR 062 End of deletion method of object "/EACC/ARCHIVING"
    A4 EFINB_TR 061 Start the deletion method for object "/EACC/JOURNALCC"
    A4 EFINB_TR 062 End of deletion method of object "/EACC/JOURNALCC"
    A4 EFINB_TR 061 Start the deletion method for object "/EACC/DERIVATION-1"
    A4 EFINB_TR 062 End of deletion method of object "/EACC/DERIVATION-1"
    A4 EFINB_TR 061 Start the deletion method for object "FINB-PERSIST"
    A4 EFINB_TR 062 End of deletion method of object "FINB-PERSIST"
    A4 EFINB_TR 061 Start the deletion method for object "FINB_GENERATOR"
    A4 EFINB_GN 044 Deletion log for client "250", application "10"
    A4 EFINB_SBU 001 Buffer "FINB_S_SBU_BUFFER_HASH_KEY", area "GN" deleted on server "srvdevnw"
    A4 EFINB_GN 040 "0" objects registered for deletion
    A4 EFINB_GN 041 "0" objects deleted
    A4 EFINB_GN 044 Deletion log for client "250", application "EA"
    A4 EFINB_SBU 001 Buffer "FINB_S_SBU_BUFFER_HASH_KEY", area "GN" deleted on server "srvdevnw"
    A4 EFINB_GN 040 "0" objects registered for deletion
    A4 EFINB_GN 041 "0" objects deleted
    A4 EFINB_GN 044 Deletion log for client "250", application "UG"
    A4 EFINB_SBU 001 Buffer "FINB_S_SBU_BUFFER_HASH_KEY", area "GN" deleted on server "srvdevnw"
    A4 EFINB_GN 040 "0" objects registered for deletion
    A4 EFINB_GN 041 "0" objects deleted
    A4 EFINB_TR 062 End of deletion method of object "FINB_GENERATOR"
    A4 EFINB_TR 061 Start the deletion method for object "FINB_SBU_DUMMY"
    A4 EFINB_SBU 001 Buffer "FINB_S_SBU_BUFFER_HASH_KEY", area "AS" deleted on server "srvdevnw"
    A4 EFINB_SBU 001 Buffer "FINB_S_SBU_BUFFER_HASH_KEY", area "XP" deleted on server "srvdevnw"
    A4 EFINB_SBU 001 Buffer "FINB_S_KF_CHARS_BUFFER_KEY", area "HA" deleted on server "srvdevnw"
    A4 EFINB_SBU 001 Buffer "FINB_S_SBU_BUFFER_HASH_KEY", area "GN" deleted on server "srvdevnw"
    A4 EFINB_TR 062 End of deletion method of object "FINB_SBU_DUMMY"
    3 ETA338 Table "KX9RABA0000108" is deleted, not copied
    3 ETA338 Table "TABADRH" is deleted, not copied
    3 ETA338 Table "TABADRS" is deleted, not copied
    3 ETA338 Table "TABADRSF" is deleted, not copied
    3 ETA338 Table "TABADRST" is deleted, not copied
    3 ETA338 Table "UCF001C" is deleted, not copied
    4 ETA346 "CABAREF          :""       0        0        0 DEL.""       0        0   16:45:01"
    +4 ETA346 "CABN             :""       0        0        0 DEL.""       0        0   16:45:01"+
    4 ETA346 "CABNNEW          :""       0        0        0 DEL.""       0        0   16:45:01"
    4 ETA346 "CABNT            :""       0        0        0 DEL.""       0        0   16:45:01"
    4 ETA346 "CABNZ            :""       0        0        0 DEL.""       0        1   16:45:02"
    4 ETA346 "CABN_EXCL        :""       0        0        0 DEL.""       0        0   16:45:02"
    4 ETA346 "CABS             :""       0        0        0 DEL.""       0        0   16:45:02"
    4 ETA346 "CACCEL           :""       0        0        0 COPY""       0        0   16:45:02"
    4 ETA346 "CACNSC_AREA      :""       0        0        0 COPY""       0        0   16:45:02"
    3 ESO672 "Number of new SAPoffice users 451"
    3 ESO672 "Number of users marked as deleted 0"
    3 ESO672 "Records deleted in SOUD: 0"
    3 ESO672 "Records deleted in SOUC: 0"
    3 ESO672 "Records changed in SOUC: 0"
    3 ESO672 "New records in SOUC: 0"
    3 ESO672 "User without address assignment 0"
    3 ESO672 "User - SO_KEY generated 0"
    3 ESO672 "User - SO_KEY not generated 0"
    3 ESO672 "User w/o entry in table USRADR 0"
    3 ESO672 "User with address assignment 452"
    3 ESO672 "User w/o entry in USR21 0"
    3 ESO672 "User with person group <> BC01 0"
    3 ESO672 "User with invalid address 0"
    3 ESO672 "User with default ADCP-SO_KEY 0"
    3 ESO672 "User - SO_KEY generated subsequently 0"
    3 ESO672 "User - SO_KEY updated 0"
    3 ESO672 "User - address not changed 452"
    3 ESO672 "User w/o where-used list 0"
    4 ETA114 Runtime "            37" seconds
    3 ETA072 Exit program "RSSOUSCO_FOR_CC" successfully executed "17:52:21"
    4 ETA114 Runtime "            58" seconds
    3 ETA072 Exit program "SFW_ADD_SWITCH_STATES" successfully executed "17:53:23"
    4 ETA114 Runtime "             0" seconds
    3 ETA072 Exit program "SXMB_CC_IS_CHECK" successfully executed "17:53:23"
    3 ETA072 Exit program "USERBUF_RESET" successfully executed "17:53:23"
    2 ETA347 Warning: Source client has logical system, target client does not
    1 ETA357 Selected tables           : "        56.790"
    1 ETA298 Copied data in kBytes  : "    12.497.003"
    1 ETA299 Deleted data in kBytes : "             3"
    1 ETA151 Program ran successfully
    1 ETA027 Runtime (seconds)         : "         8.872"
    1 ETA152 End of processing: "17:53:23"
    Thank
    Pamplona

    Sorry Anil,
    I will explain better.
    I had an HSC environment of the PRD for the environment of DEV
    My environment of the PRD has only 400 client
    In the environment of DEV I need to 2 client's (250 and 400)
    I made a copy of the client DEV 400 for 250 DEV using profile:"SAP_UCSV"
    Thank´s
    Pamplona

  • I want count "space" token in my table field and separate them

    I want count "space" token in my table one field column and separate the word between them.
    word are store in another table.
    possibly give solution in[b] Postgres DB and Oracle DB
    for example
    table name search
    column name is keyword
    keyword
    " chinese colaba" --> spaces are 2
    " chinese borivali (W)" --> spaces are 3
    " deal shoes bandra (E)" --> spaces are 4
    and separate word in new table
    field
    chinese
    colaba
    chinese
    borivali
    (W)
    deal
    shoes
    bandra
    E)
    Message was edited by:
    Rajiv_Birari

    Hi,
    Can you rephrase you Question..!!
    My understanding with your quesiton might be thinking about Partitions or Moving the data to Different tablespace.
    Thanks & Regards,
    Pavan Kumar N

  • Getting the count of DISTINCT of several columns

    How can i get the count of DISTINCT of several columns?
    SQL> select count(distinct ename) from emp;
    COUNT(DISTINCTENAME)
                      14
    SQL> select count(distinct ename, job) from emp;
    select count(distinct ename, job) from emp
    ERROR at line 1:
    ORA-00909: invalid number of arguments

    Hello,
    You should separate them out like this
    select count(distinct ename), count(distinct job) from emp;Regards

  • Deleting rows by key from several tables

    Hello! 
    One of action of my stored procedure is deleting rows from several tables on a key , that I'm getting through statement :
    delete from table3 where key_column in ();
    delete from table4 where key_column in ();
    commit;
    select key_column from Table!
    minus
    select key_column from Table2
    Unfortunately the number of lines mentioned by this statement isn't known in advance .
    How do You think , is better way to
    -- execute select each time for every delete-statement or
    -- create table as select result set and then select again keys for each delete- ststement or
    I'm usung 11.2.0.3
    Thanks and regards,
    Pavel

    By using : 1.trigger 2. on delete cascade you can achieve this.
    OraFAQ Forum: SQL &amp;amp; PL/SQL &amp;raquo; delete rows from multiple tables (more than 2 tables)
    Regards
    Girish Sharma

Maybe you are looking for