Two queries in one report?

I have Three tables like
Device_table columns are
d_id, d_name, date
Software_table
sw_id, software, version, serial_no, sw_type, d_id(foreign_key)
hardware_table
hw_id, hardware, specification, d_id(foriegn_key)
now in reports i want to attach both hardware and software, I have made two quires like
SELECT d.d_name, sw.software, sw.version, sw.sw_type from
device_table d, software_table sw
where d.d_id = sw.d_id
and second query is
SELECT d.d_name, hw.hardware, hw.specification
from device_table d, hardware_table hw
where d.d_id = hw.d_id
Now my problem is that how can I add both queries in one report so that i can get a list of software and hardware attached to one device.
Regards
Maz

I want to see the report as follow.
d_name: CPU-1
date: -----------
Software installed:
sw_id, software, version, serial_no, sw_type
(list of softwares attached, can be more then one)
Hardware attached:
hw_id, hardware, specification (same like software list, it will contain hardware list attached to specific device),
Please if you can help me that how will i make a query for this.
Thanks and Regards
Maz

Similar Messages

  • Multiple Queries in one Report

    What is the best way to show the data of 2 queries in one report?

    Hi Frank,
    It purely depends on the reporting needs I would say. You could simply add the two queries, create joins in Crystal Reports and drag the required fields in the details section.
    The joins in this case, however, would be executed by Crystal Reports, unlike when the report is created off a Relational database.
    -Abhilash

  • How to Combine two queries into One

    Hi Gurus,
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Release 10.2.0.4.0 - 64bit Production
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for Linux: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    SQL>
    I have following two queries. How I can convert these two queries into one with the same result ?
    Q1
    SELECT id,vdate,vendorname,venddate,vid
    FROM VENDOR
    WHERE processid=32
    AND venddate is null
    AND vid in(select vid from view_vid where type='PDX')
    AND (id,vdate) not in (select id,vdate from vkfl_is where task_id=55)
    AND (id,vdate) in (select id,vidate from market_data where marketed_date is null)
    AND id not in (select id from location)
    Q2
    SELECT id,vdate,vendorname,venddate,vid
    FROM VENDOR
    WHERE processid=20
    AND venddate is null
    AND vid in(select vid from view_vid where type='PBX')
    AND (id,vdate) not in (select id,vdate from vkfl_is where task_id=40)
    AND (id,vdate) in (select id,vidate from market_data where region_date is null)
    AND id not in (select id from location)
    I can UNION these two queries, but, is there any way I can write a single query with which gives me same result as above two queries?
    Any help would be highly appreciated
    Thanks in advance

    Hi,
    You can do something like this, which will be more efficient than a UNION:
    SELECT  id, vdate, vendorname, venddate, vid
    FROM  vendor
    WHERE  (   (    -- Conditions that apply only to q1
                               processid = 32
                AND  vid       IN (SELECT vid FROM view_vid WHERE type = 'PDX')
                AND (id,vdate) NOT IN ( SELECT id, vdate
                                        FROM   vkfl_is
                                        WHERE  task_id = 55
                AND (id,vdate) IN ( SELECT id, vidate
                                    FROM   market_data
                                    WHERE  marketed_date IS NULL
            OR  (  -- Conditions that apply only to q2
                     processid = 20
                AND  vid       IN (SELECT vid FROM view_vid WHERE type = 'PBX')
                AND (id,vdate) NOT IN ( SELECT id, vdate
                                        FROM   vkfl_is
                                        WHERE  task_id = 40
                AND (id,vdate) IN ( SELECT  id, vidate
                                    FROM  market_data
                                    WHERE  region_date IS NULL
                   -- The remaining conditions apply to both q1 and q2
    AND     venddate   IS NULL
    AND     id         NOT IN (SELECT id FROM location)
    I hope this answers your question.
    If not, post  a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Two Queries in one XSQL-Template

    Hi there,
    is it possibile to use two queries in one xsql-template, which are generated two seperated trees of XML?
    I think about something like that
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsql:query connection="bynet"
    null-attribute-indicator="true"
    xmlns:xsql="urn:oracle-xsql"
    rowset-element = "COLLECTION"
    tag-case="upper"
    row-element = "FIELD"
    id-attribute = "">
    select c_formtype from offer_collection
    </xsql:query>
    <xsql:query connection="bynet"
    null-attribute-indicator="true"
    xmlns:xsql="urn:oracle-xsql"
    rowset-element = "COLLECTION2"
    tag-case="upper"
    row-element = "FIELD"
    id-attribute = "">
    select c_formtype from offer_collection2
    </xsql:query>
    which should give me
    <COLLECTION>
    <FIELD>
    <C_FORMTYPE>lala</C_FORMTYPE>
    </FIELD>
    </COLLECTION>
    <COLLECTION2>
    <FIELD>
    <C_FORMTYPE>lala</C_FORMTYPE>
    </FIELD>
    </COLLECTION2>
    Any way to do this?
    Thanx for help,
    Christian Hartmann

    Sure, just enclose two <xsql:query> tags by any other outer tag:
    <something xmlns:xsql="urn:oracle-xsql" connection="demo">
    <xsql:query> select * from emp </xsql:query>
    <xsql:query> select * from dept</xsql:query>
    </something>

  • I need two query in one report (two detail section in one query)

    Hi master sorry for again distribute
    Sir I need two query in one report
    Because I need two detail section in my one report
    Such as
    Master
    Vno=9088989
    Detail          1
    =
    =
    ==
    =
    Total                     99999
    Detail          2
    =
    =
    ==
    =
    Total                     33333
    Sir how I get this type of report
    Please give me idea
    Thanking you
    Aamir

    I want to see the report as follow.
    d_name: CPU-1
    date: -----------
    Software installed:
    sw_id, software, version, serial_no, sw_type
    (list of softwares attached, can be more then one)
    Hardware attached:
    hw_id, hardware, specification (same like software list, it will contain hardware list attached to specific device),
    Please if you can help me that how will i make a query for this.
    Thanks and Regards
    Maz

  • Combining two queries in one..

    Hi,
    Can someone tell me how to combine follwoing two queries in one so that it will increase performance..
    SELECT single PLNNR from AFKO
           into T1
           WHERE AUFNR = '007200000100'.
    SELECT single STATU from PLKO
           into T2
           WHERE PLNNR = T1.

    using subqueries it is possible
    select single statu from plko into t2 where plnnr in (select single plnnr from afko where aufnr eq '007200000100').
    read about subqueries at this link...
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/dc7614099b11d295320000e8353423/frameset.htm
    regards,
    PJ

  • How to combine two queries in one EXCEL

    hi i got one requirement
    i got one excel sheet  from user which contains two  report s(hoe we know whether it is worknook or not) of  2011 data and now user wants 2012 data .now i icluded jan 2012 to dec 2012 in two reports and sent to user.But user is asking these two reports want to see in one sheet.
    so how can i proceed: if i go for work  book  how can i include these two reports in workbook and here my doubt is if i create a workbook based on  these two querie which name i have to give user.Please help me out on the same.
    Regards,
    Madhu.

    Hi Madhu
    Run one query. Click on a empty space in the excel
    From the BEx Design Toolbar -
    >Insert Analysis Grid -
    > Right click on the Design Item
    Edit the DataProvider.....You can ran same or different query with selection. 
    Save the result
    Check this link for detail....I am also searching for something with screenshot
    Regards
    Anindya
    Edited by: Anindya Bose on Feb 14, 2012 3:04 AM

  • Two Queries in one Worksheet

    Hi,
    I'd like to know what the disadvantages are of having two queries in the same worksheet of a workbook. Is it correct that the results of one query can overflow to the area of the second? How about issues with authorization, are there any?
    Thanks!

    HI,
    Yes, result of one can flow over the other if you are using simple report with characteristics and output may vary.
    Actually you apply basic Excel logic and its like 2 diff report on it.
    Mostly you add more Fixed format reports to a single sheet. So that  number of report rows dont increase and also you dont have any free characteristics to drilldown.
    About authorization, that depends on individual reports. If a user doesnt have proper authorization for 1 of the reports then that report would throw error while other would show result.

  • Two layouts in one report

    I have a requirement where I have two queries giving two different outputs, I want these two in one single report with two layouts, I was able to achieve this with Concatenate option and there by build by RTF templates based on the Groups of each query, The problem I found is the performance because everytime view is hit by choosing the required report layout both the queries are running and ther by affecting performance, Is there anyway that when I choose the layout only the query related to that layout is run and other when I choose the other layout?
    Regards

    Hi Srini,
    Thanks for your response!
    I am not using my "back button".
    Clicking the report first time in a session (or viewing the report after modifying it) opens "html" and next time onwards it opens last selected template layout and output format. I am not sure whether this is a bug or intended behavior.
    Thanks,
    Ashok

  • Results of multiple queries in one report

    Hi
    I would like to create one report with multiple rows and each row should display result of a different query.
    I guess I can use multiple report on one region or multiple regions in one place.
    (1)However is there a more elegant way of creating a single report look and feel...eg like it would happen in excel.
    (2)Is it better to have one page with multiple regions or multiple reports in one region.
    Thanks
    Faizi

    I'm not sure if it suite your needs,
    but maybe you can use UNION in your queries to get them together in one report ??
    Second option:
    Denes did great work and he created some how-to about putting mulitple reports in one region:
    http://deneskubicek.blogspot.com/2007/06/multiple-reports-in-one-region.html
    Hope this helps.
    Tomasz K.

  • Combining two queries to one

    I have two queries and I would like to output the results as
    one and sort by Name ASC
    Any help would be great thanks

    Either use union in your SQL query or use Coldfusion to
    combine exisitng queries and create a new query resultset.
    Something like this:
    <CFQUERY NAME="getDetailsQuery1"
    DATASOURCE="#DSNNAME#">
    SELECT * FROM getDetailsA
    </CFQUERY>
    <CFQUERY NAME="getDetailsQuery2"
    DATASOURCE="#DSNNAME#">
    SELECT * FROM getDetailsB
    </CFQUERY>
    <CFQUERY NAME="getDetails" DBTYPE="query">
    SELECT * FROM getDetailsQuery1
    UNION
    SELECT * FROM getDetailsQuery2
    ORDER BY Name ASC
    </CFQUERY>
    Hope this helps!
    Cheers / Manu.

  • Two queries in one output in BEx is it possibl ?

    Hi,
               Is there a possibility in Bex Excel screen that we can output two queries at the same time , like 1st query in first half and second query 2nd half of the screen .I think its not possible but just wanna know if anyone came across such an issue
    I know it is possible with WAD ...

    Hi Raj,
    You can execute 2 queries in one work book.First execute one query,place the cursor under query results area,go to tools->Insert query->execute.Save->Save existing work book.
    When ever u open the work book u have to execute both the queries.Instead of executing twice you can use some options, so that it saves and reuses the input values and automatically refresh the queries when u open the work book(If the input values are fixed).
    For that right click->Properties->Intraction tab
    You can see 4 check boxes.check all boxes,ok for all queries and save.So when u open the work book it retrieves data.No need to give input values

  • How do i run two queries in one worksheet?

    Hi
    I am new to Disco and am finding some things easy to fathom and others not so.
    I have a table with fields
    callref
    logdate
    closedate
    I want to be able count the number of calls logged each month/year and the number of calls closed.
    So, I want to do 2 counts, each count applying a slightly different condition. I would then end up with data along the lines of:
    Month, Number Logged, Number Closed
    which I could then turn into a graph.
    I am assuming there must be an obvious way ...
    Sapphie
    Edited by: user12160673 on Feb 8, 2010 8:49 AM

    Hi Lee
    There's a couple of ways of doing this. I think the simplest would be create two calculations, one for Number Logged and one for Number Closed.
    For Number Logged presumably this is just the count of all rows returned in the worksheet? You can use COUNT(ROWNUM) for that calculation.
    For the Number Closed you only want to count those that have a closedate - yes? If so, this will work:
    SUM(CASE WHEN closedate is NOT NULL THEN 1 ELSE 0)
    Another way to do this, would be to create two analytic calculations, one for each count. The syntax for an analytic count is as follows:
    COUNT(item) OVER (filters)
    The item will be the thing you are counting. The filters can be left empty, in which case the count will be determined by all rows in the worksheet. If you want the count to be only on a subset of the rows then you need to provide one or more filters. Typical filters are page items and group sorted items.
    An example of a count over the whole query is:
    COUNT(callref) OVER ()
    Best wishes
    Michael

  • Two Queries In One Workbook With Calculations

    Hi Guys,
    Can you have 2 queries in one worksheet, either ran as a query or save as a workbook and calculation done at runtime.  For example, query A and query B to show up in one sheet when you run query A.  You now want a simple calculation done......for example.......A1 row from query A divided by B1 row from query B.  The result to show up on the Key Figure structure in query A.
    Thanks,
    Recca
    Edited by: Recca Recca on Jul 11, 2011 4:45 PM

    Hi,
    I am not sure about this but we had similar kind of requirement and what we did was,
    One query in one tab, another query on second tab and we did key figure calculations on third tab of the workbook eg. Sheet1 A1 - Sheet2-A1 and the result was stored on sheet3.
    We saved the workbook and used to refresh the same whenever we want to see new data.
    Regards,
    Durgesh.

  • Two queries to one question or how to query TV Scheduler

    In my procedure I need to query an existed view, which has the follow columns: broadcasting_day_id (unique), broadcasting_date, channel_id and version and so.
    If I have broadcasting_day_id, than I need to use WHERE broadcasting_day_id = my_parameter_1, if no, than I use WHERE broadcasting_date = my_param_2 AND channel_id = my_param_2 AND version = my_param_3.
    Right now I have implemented it using IF broadcasting_day_id is not null THEN SELECT .... FROM .... WHERE broadcasting_day_id = my_param_1 ELSE WHERE
    broadcasting_date = my_param_2 AND channel_id = my_param_2 AND version = my_param_3.
    I would like to know if this is a good approach and if there is a way to combine those two statements in one, please?
    Thanks in advance

    Hi,
    If your query is fairly complicated and you don't like to repeat it, you could try something like:
    WHERE  broadcasting_day_id =   NVL2 (my_parameter_1, my_parameter_1, broadcasting_day_id)
           AND broadcasting_date = NVL2 (my_parameter_1, broadcasting_date, my_param_2)
           AND channel_id =        NVL2 (my_parameter_1, channel_id, my_param_3)
           AND version =           NVL2 (my_parameter_1, version, my_param_4);(Assuming you have four different parameters, you mentioned p2 twice)
    Regards
    Peter
    Edit:
    Yes, I know - looks kinda stupid after Ganesh got his nvl2 logic right ;)
    Edited by: Peter on Apr 27, 2011 1:44 PM

Maybe you are looking for

  • Can you use a network share as location for users' home

    I am running a Mac mini with Mountain Lion and Server.app as a home server. For added storage space I have a NAS. I would like to set up the open directory network users' home share on the NAS. Is that even possible? I am able to mount the network sh

  • [SOLVED] Removing "auto eth0" connection in networkmanager.

    Is there a possibility to remove "auto eth0" connection in nm? When I try to remove this connection I get this output: "Usuwanie połączenia nie powiodło się: nm-settings.c.333 - Read-only connections may not be deleted.." Last edited by Szelek (2009-

  • Implementing a BaDI

    Guys, I have found a BaDI in include LV60AA95 and want to know if I can put my own abap code within an associated method (l_sd_billing_item_exit->vbrk_vbrp_data_transfer). If so, how do I actually put the code there? What steps do I have to follow.

  • BSO to ASO Partitioning Help

    Can anyone help me with a couple questions in regards to our partitioning strategy from our Block Storage planning cube to our Aggregate storage planning cube in 11.1.2? Our original approach was to use a transparent partition for planning scenario (

  • DNG vs JPG input to LPC

    Is there a loss of profile quality using jpegs vs DNGs ? This should speed up the LPC process a lot for big projects.