Query possible?

Hi Experts,
Please help me in designing a query for the below given requirement.
The Flow:
I have three DSO's X, Y, Z and a multiprovider over them. The three DSO's have a key figure each to be displayed in the report.
Report requirment:
The report needs to have a calender month as a Variable with range.
There is a separate logic for each DSO to fetch data.
For X: the values for the key figure should fetch with the logic 0CALMONTH - 3.
Suppose: if the user enters dec 2011 the keyfigure should get populated with september values.
For Y: if the 0CALMONTH < Current Month, then 0CALMONTH = current month.
suupose if 0CALMONTH = DEC 2011, then it should get converted to FEB 2012. If it is APRIL 2012 then it should be as it is.
The keyfigure values should be fetched based on the new 0CALMONTH value.
For Z: There is no logic for this. the key figure should ftech values for the 0CALMONTH entered.
Can we design a query for the above requirement? If there please help.

Hi Deepti,
  You can acheive this as below.
Create two restricted key figure.
1) RKF1 :  Use the keyfigure from DSO X and restrict  characteristic calmonth with  the input entry variable calmonth Then keep offset on this variable as variable - 3 which will restrict the DSO X Key figure to input month - 3 months or n months what ever is required.
2) RKF2 : Use the key figure from DSO Y. And restrict the characteristic calmonth with new  variable ( CMOD Processing) . And in CMOD we will use the input month variable and if this input is less than current month then it will be current month.
3) And for the third key figure use it as normally.
Regards
Vamsi

Similar Messages

  • How many query possible in 1 second at Sql Server ?

    Hello
    I have 30,000 records. Table have 10 columns. Columns have indexes if column at where condition. And select question will give 20-30 records as result. (select column1, column2,...... column10 from table where columnSecondID=2I. I will use hosting standart
    plane. 
    How many query possible in 1 second at Sql Server 2008 ?
    How many query possible in 1 second at Sql Server 2012 ?
    How many user can visit my web site ?

    Hello
    I have 30,000 records. Table have 10 columns. Columns have indexes if column at where condition. And select question will give 20-30 records as result. I will use hosting standart plane. 
    How many query possible in 1 second at Sql Server 2008 ?
    How many query possible in 1 second at Sql Server 2012 ?
    How many user can visit my web site ?
    That's hard to say. One second for CPU is quite high time and CPU can do lot of work in that time. again, this is relative and depends on what the query is.
    The biggest bottleneck in performance is - Disk IO system. In general, if  the required data is in memory, it can help significantly in improving the performance.
    Remember, CPU will be doing other processing work while it is fetching the data from disk.
    What you need to is  - load test or stress your server. There are some tools available for you to do it. 
    RML : https://support.microsoft.com/en-us/kb/944837?wa=wsignin1.0
    distributed replay : https://msdn.microsoft.com/en-us/library/ff878183.aspx
    to test IO : http://www.brentozar.com/archive/2008/11/storage-performance-testing-with-sqlio/
    read this : http://www.brentozar.com/archive/2012/06/load-test-sqlserver/
    You also need to look at Max worker thread limitations. this depends on the server configuration(64 bit/32 bit) and other factors...
    https://technet.microsoft.com/en-us/library/ms187024%28v=sql.105%29.aspx
    one problem that can happend is thread pool starvation where there are too many connections
    happening if your server cannot keep up with the workload.. like if your cpu is working in processing the queries and cannot accept new connections..
    watch this good youtube video on thread pool starvatioin :
     https://www.youtube.com/watch?v=XJ67oHBM2Hw
    Hope it Helps!!

  • More than 1 variable in query possible?

    hi friends,
    how are you, can i use more than 1 variable in 1 query, if possible , can u give me 1 scenerio ple?

    Sunil,
    Do you mean more than one variable per characteristic?  If so I'm afraid not, you will get a Complex Selection message.
    Hope this may help,
    Regards
    Gill

  • Is this type of query possible (select with rows stopping based on match)

    I'm trying to write a SQL query and suspect it can't be done. Or at least, I can't mentally grasp it, despite various stabs with subqueries. I've simplified it by changing the metaphor here a little.
    Let's say I have a truck in some city (say, Chicago). There are various roads leading out of that city, with routes we'll label according to compass points (N, NE, SW, etc.) Each truck can carry only one shipment. It starts going along its road, and as soon as it comes to a city that needs its shipment, it stops.
    Yes, a cooked example, but it's similar to my problem.
    Here is a table:
    TABLE: truck_routes
    scenario (integer - different possible scenarios)
    route (NE, SW, etc. - 8 compass directions)
    destination (cities along that road)
    sequence_number (order in which to go to those cities)
    So if I have a trucks in Chicago, I can say
    SELECT route, sequence_number, destination
    FROM truck_routes
    WHERE scenario = 10 (or whatever)
    ORDER BY road_out, sequence_number;
    And I'd get a report like this:
    SE 1 Gary
    SE 2 Valparaiso
    SE 3 Plymouth
    SE 4 Warsaw
    NE 1 Michigan City
    NE 2 Kalamazoo
    NE 3 Grand Rapids
    NE 4 Cadillac
    NE 5 Traverse City
    So far so good. I have another table with a list of cities that need to receive the shipment:
    TABLE: cities
    scenario (integer - different possible scenarios)
    route (NE, SW, etc. - 8 compass directions)
    destination (same keys as in truck_routes)
    e.g.:
    10 SE Valparaiso
    10 SE Warsaw
    10 NE Cadillac
    10 NE Traverse City
    Now...the tricky part...how do I rewrite the query above so that after a truck hits a city that needs a shipment (in that scenario) it stops? In other words, I want a report (for all routes) of what cities the truck will stop at - and as mentioned, it stops at the first one it makes a delivery. I don't want to see rows beyond that. So the report would look like this:
    SE 1 Gary
    SE 2 Valparaiso
    NE 1 Michigan City
    NE 2 Kalamazoo
    NE 3 Grand Rapids
    NE 4 Cadillac
    Gary shows up because it doesn't require a delivery. Valparaiso (SE route, sequence_number 2) shows up because it takes the delivery. The rest of the Southeast route doesn't show up. Same thing for the NE route.
    There are scenarios where I'd actually want to stop at the city just prior to the delivery destination, etc., and of course in the real world it's more complicated, but I think if I could get this model working I could flesh it out into a real-world query.
    I can certainly code something in PL/SQL to do this, or do it in application logic - but I'm wondering if there is a way to do it in a single SQL statement? I suspect there's something that could be built with subqueries and sorting, but...I can't quite reach it ;-)

    WITH report AS(
        SELECT 'SE' route, '1' seq_num, 'Gary' dest  FROM DUAL UNION ALL
        SELECT 'SE' route, '2' seq_num, 'Valparaiso' dest FROM DUAL UNION ALL
        SELECT 'SE' route, '3' seq_num, 'Plymouth' dest FROM DUAL UNION ALL
        SELECT 'SE' route, '4' seq_num, 'Warsaw' dest FROM DUAL UNION ALL
        SELECT 'NE' route, '1' seq_num, 'Michigan City' dest FROM DUAL UNION ALL
        SELECT 'NE' route, '2' seq_num, 'Kalamazoo' dest FROM DUAL UNION ALL
        SELECT 'NE' route, '3' seq_num, 'Grand Rapids' dest FROM DUAL UNION ALL
        SELECT 'NE' route, '4' seq_num, 'Cadillac' dest FROM DUAL UNION ALL
        SELECT 'NE' route, '5' seq_num, 'Traverse City' dest FROM DUAL 
    cities AS (
        SELECT '10' scenario, 'SE' route, 'Valparaiso' city FROM DUAL UNION ALL
        SELECT '10' scenario, 'SE' route, 'Warsaw' city FROM DUAL UNION ALL
        SELECT '10' scenario, 'NE' route, 'Cadillac' city FROM DUAL UNION ALL
        SELECT '10' scenario, 'NE' route, 'Traverse City' city FROM DUAL
    need_a_shipment AS (
          SELECT r.*
              , CASE WHEN EXISTS( SELECT 'Y' FROM cities c WHERE c.route = r.route AND c.city = r.dest )
                     THEN 'Y'
                     ELSE 'N'
                END need_a_shipment
        FROM report r
    SELECT  route
          , seq_num
          , dest
          , need_a_shipment
    FROM need_a_shipment n
    WHERE seq_num <= (  SELECT MIN(seq_num) FROM need_a_shipment
                        WHERE route = n.route AND need_a_shipment = 'Y' )
    ORDER BY route DESC, seq_num
    ROUTE SEQ_NUM DEST          NEED_A_SHIPMENT
    SE    1       Gary          N              
    SE    2       Valparaiso    Y              
    NE    1       Michigan City N              
    NE    2       Kalamazoo     N              
    NE    3       Grand Rapids  N              
    NE    4       Cadillac      Y

  • Is a single Query possible for this?

    Hi everyone,
    I have a requirement to get a list of 10 free (non-assigned) ids from a table. The ids range from say 1-32000. The table contains only the assigned ids. So the idea is - if say we have 15 records already in this table like 2,7,23,4,65,22,665... etc (random, non-repeated, unsorted values), then I need to get the first 10 numbers in the range 1-32000 which are not there in the table e.g. 1,3,4,5,6,8,...etc. One idea is to have a table2 with a single column having values 1-32000 i.e. 32000 rows. Then we can give the query like -
    select col1 from table2 where rownum<=10 and col1 not in (select id from table1);
    Is there a better way to get this output without having a separate table with 32000 rows? Or, is it possible to form a faster query even with the proposed solution?
    Thanks,
    Regards
    Sanchayan
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by [email protected]:
    Hi everyone,
    I have a requirement to get a list of 10 free (non-assigned) ids from a table. The ids range from say 1-32000. The table contains only the assigned ids. So the idea is - if say we have 15 records already in this table like 2,7,23,4,65,22,665... etc (random, non-repeated, unsorted values), then I need to get the first 10 numbers in the range 1-32000 which are not there in the table e.g. 1,3,4,5,6,8,...etc. One idea is to have a table2 with a single column having values 1-32000 i.e. 32000 rows. Then we can give the query like -
    select col1 from table2 where rownum<=10 and col1 not in (select id from table1);
    Is there a better way to get this output without having a separate table with 32000 rows? Or, is it possible to form a faster query even with the proposed solution?
    Thanks,
    Regards
    Sanchayan<HR></BLOCKQUOTE>
    Sanchayan,
    Your problem can be solved by a single query.
    Try the following query:
    (THIS WILL GIVE AN IDEA")
    select * from (
    select rownum from (select numero from srm_test)
    minus
    select numero from srm_test)
    where rownum < 10
    order by 1
    YOU WILL GET:
    ROWNUM
    1
    3
    6
    8
    10
    11
    12
    7 rows selected.
    The contents of srm_test are:
    2, 7, 23, 4, 65, 22, 665, 90, 87, 200, 9, 5
    null

  • Is "Joins & For all entries" in same SQL Query Possible?

    Hi all Professional,
    Can we use "Inner Joins" and "For All Entries In" in the same SQL Query. if possible then pls clarify this query.
    Here I am using three Transparent Table and fetching data from them.
    SELECT abukrs abelnr ahkont axref2 ashkzg awrbtr agsber azfbdt azterm amwskz asgtxt axref1 agjahr abuzei
               bkunnr bwerks bmenge bmeins bmatnr bkoart
               cbukrs cbelnr cblart cbldat cbudat cxblnr cgjahr cstgrd cstblg cstblg c~xreversal
               INTO CORRESPONDING FIELDS OF TABLE it_bsid FROM ( ( bsid AS a
               INNER JOIN acctit AS b ON abukrs = bbukrs )
               INNER JOIN bkpf AS c ON cbukrs = abukrs
                                   AND cbelnr = abelnr
                                   AND cgjahr = agjahr )
               FOR ALL ENTRIES IN it_bkpf
                  WHERE
                    a~belnr EQ it_bkpf-belnr
                AND a~gjahr EQ it_bkpf-gjahr
                AND a~bukrs EQ it_bkpf-bukrs
                AND a~gsber IN so_bus.
    After executing this query, I'm getting Dump Error.
    Error analysis
        When the program was running, it was established that more
        memory was needed than the operating system is able to provide savely.
        To avoid a system crash, you must prevent this
        situation.
                   Last error logged in SAP kernel
        Component............ "EM"
        Place................ "SAP-Server Development_DVL_01 on host Development (wp
         2)"
        Version.............. 37
        Error code........... 7
        Error text........... "Warning: EM-Memory exhausted: Workprocess gets PRIV "
        Description.......... " "
        System call.......... " "
        Module............... "emxx.c"
        Line................. 1886
    Pls resolve, if anybody knows.
    Thanks
    Devinder

    Hi,
    During testing i notice that splitting into multiple selects does improve performance. But the best performance I achieved using DB Hints instead of splitting the select statements.
    Generally performance of joins together with for all entries is bad.
    However if you will look into SAP note 1662726 you will notice that this issue (bad performance in using join and for all entries together) has been addressed.
    Even though the note is for HANA DB, FM RSDU_CREATE_HINT_FAE can be used independent of DB.
    On HANA DB performance improvement is huge (i achieved 62 seconds using DB Hints compared to 1656 seconds using for all entries). On Oracle DB the same code initially run in 99 seconds with for all entries and with DB Hints in 82 seconds for ~ 1.000.000 records and ~660 seconds compared to 1349 seconds for ~8.000.000 records..
    Sample code from SAP Note below:
    Original statement:
    SELECT COL1 COL2 COL3 COL4 COL5
      FROM TAB1
      INTO CORRESPONDING FIELDS OF TABLE LT_RESULT
      FOR ALL ENTRIES IN LT_SOURCE_TMP
      WHERE COL3 = LT_SOURCE_TMP-COL3
      AND   COL4 = LT_SOURCE_TMP-COL4
      AND   COL5 = LT_SOURCE_TMP-COL5
    Revision:
    DATA: L_T_TABLNM TYPE RSDU_T_TABLNM,
          L_LINES TYPE I,
          L_HINT TYPE RSDU_HINT.
    APPEND 'TAB1' TO L_T_TABLNM.
    L_LINES = LINES( LT_SOURCE_TMP ).
    CALL FUNCTION 'RSDU_CREATE_HINT_FAE'
      EXPORTING
        I_T_TABLNM   = L_T_TABLNM
        I_FAE_FIELDS = 3
        I_FAE_LINES  = L_LINES
        I_EQUI_JOIN  = RS_C_TRUE
      IMPORTING
        E_HINT       = L_HINT
      EXCEPTIONS
        OTHERS       = 0.
    SELECT COL1 COL2 COL3 COL4 COL5
      FROM TAB1
      INTO CORRESPONDING FIELDS OF TABLE LT_RESULT
      FOR ALL ENTRIES IN LT_SOURCE_TMP
      WHERE COL3 = LT_SOURCE_TMP-COL3
      AND   COL4 = LT_SOURCE_TMP-COL4
      AND   COL5 = LT_SOURCE_TMP-COL5
              %_HINTS ADABAS  L_HINT.
    Best regards,
    Octavian

  • RRI: refresh in the target query possible?

    Hello BW Experts,
    I have send the customers c1, c2 and c3 to the target query.
    Q1 -(c1,c2,c3)> Q2
    Q2 is a customer level query.
    if jump from Q1 --> Q2.If I refresh Q2 will i be able to look at all the customers otherthan c1,c2,c3 ?
    Please suggest.
    Thanks,
    BWer

    Hi,
    Possible if the jump query (Q2 in this case) is a separate query with its own selsction screen and customer as a selection criteria in there.
    Cheers,
    Kedar

  • Dataservice local AIR cache - User SQLite Query Possible??

    Hi All
    Does anyone know if it is possible to query against offline cachid database (created by dataservices 2.6.1 and AIR 1.5.x)
    So, for example I need to do something like:
    SELECT * from STOCKTABLE WHERE STOCKTABE.NAME LIKE %myproductname%
    The main reason I need to do this is, because I need to use the sql 'LIKE' keyword, rather than program my own 'smart' search routines...
    Having loaded the dataservice cacheid db file, I can query against a table some tables but it seems obvious that the schema is not designed for users (like myself) to load and query against...but still worth asking:)
    Any help, much appreciated.
    Jasen

    Anil
    Thankyou for your reply, sorry it took sooo long for me to acknowledge it:)
    Unfornately, we do have access to DS3.1, we only have access to 2.61 ATM.
    To get around this issue, we are using AdvancedDataGrid and using field sort for three fields. This is on 5000 or so items of flat data and it takes some time to complete the update (Apparently AIR2 has faster routines, but not sure how much faster...)
    Look forward to having access to DS3.1 at some time in the future...but until then 2.61 is it.
    Just to relaborate, we need to build a hiearchical tree from flat data,for example:
                     groupingCollection    =    new GroupingCollection();
                     grouping    =    new Grouping();
                     fields        =     new Array();
                     fields.push(new GroupingField( "web_Category_Level_1", true ));
                     fields.push(new GroupingField( "web_Category_Level_2", true ));
                     fields.push(new GroupingField( "web_Category_Level_3", true ));//this field is not always present
                     grouping.fields    =    fields;
                     groupingCollection.grouping    =    grouping;
                     groupingCollection.refresh(true);
    However, some fields in the flat data only have two fields, thus only giving two levels in the tree, but I am not sure how to sort for two fields and/or three fields in the flat data returned from a dataService.fill().
    Had looked into compare groupingObjectFunction and groupingCompareFunction but did not have much luck...
    So, that is why I was hoping to be able to query the local dataservice cache directly and build the tree using lazy loading methods (just like using SQL queries on a remote server)
    Cheers
    jvm

  • BW Tree Hierarchy-multiple selection for query possible?

    Hello,
    I have a question in regards to BW Tree Hierarchies and its usage in Bex Reporting:
    Is it possible to select multible Tree Hierarchy (based on the same characteristic) when executing a query in Bex Analyzer. If yes, how?
    I tried to configure this by making use of a hierarchy variable on the characteristics, but it does only allow me to select one hierarchy.
    Thanks for your help,
    Elisabeth

    Elisabeth,
    Your query can only assign one hierarchy per characteristic.
    If you need multiple ones - I'd suggest you make a query per hierarchy and you can user Query Views in the WAD to let the user select the View (i.e.. the Hierarchy) they wise.
    Regards
    Gill

  • Ajax and JSTL Query possible?

    Hi all ! I want to know if this is possible and if you have an example you could show. So far Im trying like this:
    function ajaxFunction(){
         alert("ajaxFunction");
         var ajaxRequest;  // The variable that makes Ajax possible!
         try{
              // Opera 8.0+, Firefox, Safari
              ajaxRequest = new XMLHttpRequest();
         } catch (e){
              // Internet Explorer Browsers
              try{
                   ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
              } catch (e) {
                   try{
                        ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
                   } catch (e){
                        // Something went wrong
                        alert("Your browser broke!");
                        return false;
         // Create a function that will receive data sent from the server
         ajaxRequest.onreadystatechange = function(){
              if(ajaxRequest.readyState == 4){     
              appendOptionLast(ajaxRequest.responseText);
         //var age = document.getElementById('age').value;
         //var wpm = document.getElementById('wpm').value;
         //var sex = document.getElementById('sex').value;
         //var queryString = "?age=" + age + "&wpm=" + wpm + "&sex=" + sex;
         //alert("Antes open");
         ajaxRequest.open("GET", "/TWC/Comun/Ajax.jsp", true);
         //alert("Despues open");
         ajaxRequest.send(null);
    }And here is my JSP thats doing the query.
    <%@page contentType="text/html"%>
    <%@ page import="beans.*,java.util.*" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix=”sql” %>
    <%@page pageEncoding="ISO-8859-1"%>
    <sql:setDataSource dataSource=”jdbc/TWC” />
    <sql:query var=”qryItems” >
        SELECT User_ID
        FROM product
        ORDER BY nombre
    </sql:query>
    <c:forEach var=”row” items=”${qryItems.rows}”>
         User: <c:out value=”${row.User_ID}” /><br> 
    </c:forEach>Thanks!

    thanks guys but I finally got it to work with JSTL and ajax.
    The only "weird" thing is that when I parse the data to my JSP I get a bunch of white spaces at the end of each value for each field. Here is my code:
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
    <sql:setDataSource dataSource="jdbc/TWCApp" />
    <sql:query var="producto">
    select ITEMDESC AS name,IV00101.ITEMNMBR AS Number,USCATVLS_2 AS category,USCATVLS_1 AS Brand,
    USCATVLS_3 AS Type,CURRCOST AS Invoice_price,
    QTYONHND AS Stock_number, IV00102.LOCNCODE AS Location
    from TWC.dbo.IV00101 JOIN TWC.dbo.IV00102 ON IV00101.ITEMNMBR=IV00102.ITEMNMBR
    WHERE IV00101.ITEMNMBR = '${param.product}' AND IV00102.LOCNCODE = '${param.location}'
    </sql:query>
    <c:forEach items="${producto.rows}" var="row">
    ${row.name},${row.number},${row.category},${row.brand},${row.type},${row.Invoice_price},${row.Stock_number},${row.Location}
    </c:forEach>Here is my JS:
    ajaxRequest.onreadystatechange = function(){
              if(ajaxRequest.readyState == 4){     
              appendOptionLast(ajaxRequest.responseText);
    function appendOptionLast(valor)
      //alert(valor);
      //var elOptNew = document.createElement('option');
      var elSel = document.getElementById('category_producto');
      var mySplitResult = valor.split(",");
      document.form1.nombre_producto.value=mySplitResult[0];
      document.form1.numero_producto.value=mySplitResult[1];
      document.form1.category_producto.value=mySplitResult[2];
      document.form1.brand_producto.value=mySplitResult[3];
      document.form1.type_producto.value=mySplitResult[4];
      document.form1.invoice_producto.value=mySplitResult[5];
      document.form1.stocknumber_producto.value=mySplitResult[6];
      if(mySplitResult[6]>0){
      document.form1.stock_producto.value="Available"
      else{document.form1.stock_producto.value="Out of stock"
      document.form1.location_producto.value=mySplitResult[7];So how I can get rid of all those extra spaces at the end of each value?
    thanks!
    Edited by: juanmanuelsanchez on Apr 2, 2010 11:29 PM
    Edited by: juanmanuelsanchez on Apr 2, 2010 11:32 PM

  • Heterogeneous query possible?

    I know this must get asked a lot, but I can't seem to get a good answer on a search.
    Situation: Table A resides on Oracle Server 1in Accounting, table B on Sybase Server 2.in Marketing (two different physical machines). Table A has a part number, Table B has its description.
    Question: Is there any way to return a single ResultSet (like "select A.partnum, B.desc from Accounting.Orders A, Marketing.Catalog B") from a single query, or must one query (A) be executed first, then a separate query on B executed for each row in ResultSet A?
    Wouldn't you need two connections and two data sources? Is there a way to do it if both servers are running Oracle?
    Any help greatly appreciated!
    Thanks,
    Reece Watkins

    Question: Is there any way to return a single
    ResultSet (like "select A.partnum, B.desc from
    Accounting.Orders A, Marketing.Catalog B") from a
    single query, or must one query (A) be executed first,
    then a separate query on B executed for each row in
    ResultSet A?HETERGENOUS DATABASE JOINS
    There are third party tools called Gateways that would allow this query across different vendor databases. This would allow you to execute a single query and return a single ResultSet. These third party tools are sometimes provided by the database vendors themselves (i.e. Oracle has a gateway for accessing mainframe DB2). I have not used these gateways with JDBC, but I cannot think of reason why they would not work with JDBC.
    Wouldn't you need two connections and two data
    sources? Is there a way to do it if both servers are
    running Oracle?USING ORACLE ONLY
    If you are running Oracle, you can setup an Oracle "link" between the two databases that allows you to code a single query that hits one or more Oracle databases to return a result set. You can do something similiar in most major databases.
    PROPRIETARY TEMP TABLE SOLUTION
    Another possible solution that avoids having to code your own mini-database engine, is to open up two connections, one to database A and one to database B. Then run query A against database A and store the ResultSet as a temporary table on database B. Now run your full query against database B against B's native tables and your temporary table. This avoids having to write functions to group, sort, avg, etc because you have the full power of database B at your disposal.
    In any case, using a third party Gateway, an Oracle link or some proprietary temp table solution, you will be eschewing performance for flexibility. That doesn't mean it is not a valid or good solution, only that scalability can be limited when runnning queries that span more than a single database regardless of the method.

  • Combining 2 recordsets in one query possible?

    Hello,
    I've simplified my 2 queries. Is it possible to combine the 2
    queries to get the total?
    I use in my query window (in Dreamweaver)
    (SELECT COUNT(*) FROM table_1 WHERE field_1="X") + (SELECT
    COUNT(*) FROM table_2 WHERE field_1="Y") AS TOTAL
    When I click 'TEST', I got a message that SQL Syntax is
    wrong.
    Any ideas?
    Regards.

    .oO(cosmobe)
    >Just tried this and I get the count from the 2 queries in
    my query result-pane
    >
    >line 1: 4
    >line 2: 6
    OK, I misread your question. My fault.
    >How can I calculate the SUM of those 2? Can I do this?
    Sure. I would probably do it in the script, but you can also
    do it with
    SQL already. One way would be to use sub selects:
    SELECT
    (SELECT COUNT(*) FROM table_1 ...) +
    (SELECT COUNT(*) FROM table_2 ...)
    AS total;
    Micha

  • Extending the Seeded View, Join query possible??

    I am extending a seeded VO(oracle.apps.pos.changeorder.server.PoViewLinesVO). Thsi VO has teh attributes of polineid, poheaderid,...
    In my custom VO where i ame xtending the PoViewLinesVO, there i need to take the fields attribute_category and attribute1 from po_lines_all table, here in custom VO i need to pass the "polineid" from the seeded VO, and tehn i have to take its respective "attribute_category and attribute1". How can i do this, can its possible to write some join condition or through controller only its possible?
    Please help me....

    You can write the custom sql with joins in the extended VO.
    --Shiv                                                                                                                                                                                           

  • Is Query possible in SAPSCRIPT

    I want to use select statement inside SAPSCRIPT .
    Is it possible ?

    Yes so in subroutine you can always pass the value and then write the select in subroutine and then pass the value back to sapscript.

  • AdHoc Query - possible to choose text and value for a field

    Hi
    One of our infosets is based on the LDB for travel (PTRVP).
    For this infoset, PERNR is delivered from P0001.
    However, this field does not deliver a text, so the user cannot choose "value and text" as they can for PERNR in the LDB PNPCE.  The only difference seems to be that PNPCE fetches PERNR from P0000.
    Can anyone tell me how to provide text options for the field?
    I have tried the method described in IMG with no luck (probably doing something wrong).
    Should mention that I am no expert programmer.
    Thanks
    Kirsten

    The Text in PERNR is just the Employee Name (ename). The users can get that from IT0002 anyways. They can choose Last name, First name or ename.
    Sanghamitra

Maybe you are looking for