Another way of writing a query using IN...

Hi ,
Is there another way to write the following query?
select DISTINCT TEST_DESCR_F
FROM TEST_CATALOG
where test_code in (select exetasi from parag_aktin
where barcode='090320061')
Thanks , a lot
Simon

It is a bit unfair to compare the run time statistics of queries that only you can run. If you want people to be able to make suggestions that are more efficient you should
A) State that is your requirement.
B) Post table create scripts and sample data.
Having said that you can try this
select distinct test_descr_f
from test_catalog a, parag_aktin b
where a.test_code = b.exetasi
   and b.barcode = '090320061'It is certainly different, whether it is more efficient only you can know.

Similar Messages

  • Is there any way to get the query used in discoverer from backend??

    Hi All,
    I am new to dicoverer.
    Is there any way to get the query used in discoverer from backend??
    Thanks,
    Sachin

    Hi,
    you can view the SQL from within the discoverer menu:
    in desktop: View-> SQL Inspector
    in Plus: Tools-> Show SQL
    The SQL in the DB tables is encrypted so it's a problem getting it from there.
    You can export the workbook into SQL but it is not working for every worksheet (subquery, inline pivot tables...)
    you can create a batch file to export them all using the output of this script:
    select null,null,'echo off'
    from dual
    union all
    select distinct
    qs.qs_doc_name Workbook_name,
    qs.qs_doc_details Worksheet_Name,
    'start /wait <path>\dis51usr.exe /connect '||'&p_user_name'||'/'||'&p_password'||'@'||'&p_env'||' /apps_user /apps_responsibility "&responsibility" /opendb '||
    chr(34)||qs.qs_doc_name||chr(34)||' /sheet "'||qs.qs_doc_details||'"'||' /export SQL "C:\Export Discoverer SQL\'||qs.qs_doc_name||'-'||qs.qs_doc_details||'.sql" /batch'
    from eul_us.eul5_qpp_stats qs
    where qs.qs_doc_name is not null
    --order by 1,2
    union all
    select null,null,'echo off'
    from dual
    union all
    select null,null,'exit'
    from dual

  • Exact way in writing a query

    hi, i have a requirement in which i should develop a report in discoverer for the
    employees elements and their pay.
    As am new to discoverer, i want to put the steps which i'm going to implement infront of you.
    1) I'am trying to create folders for the tables i need in my query using
    discoverer administration.
    2) I'am trying to build a relation between these table and build required parameters using discoverer desktop.
    3) I'am going to save the worksheet and give the access to the required users.
    Please tell me if i'am missing anything or doing something wrong.
    Thank a ton.
    kumar

    Step 1 looks good
    In Step 2, the folders get joined in the admin tool, but the report/query/workbook can be created in desktop
    In Step 3, the report should be shared with the required users. You will also have to go back to the admin tool and make certain the users have access to the business area(s) used in the report. Users will also have to be able to access the actual database objects on which the folders are based. BA access and database acess can be done using roles, if desired.

  • Writing a query using a multisource-enabled data foundation

    I know there is an easy way to do this but Iu2019m suffering from a mind block late on a Friday afternoon.
    What I have is a multisource-enabled data foundation that is reading data from a connection to multi-cube MC07 in our DEV system and multi-cube MC07 in our QAS system. The two multi-cubes are joined in the data foundation on create date and contract number.
    Here is what I have done so far:
    -     Created two relational multisource-enabled connections. One connections to multi-cube MC07 in DEV system and one to multi-cube MC07 in our QA system, one to a  to DEV BW and
    -     Created a multi-source data foundation on the connections with joins on create date and contract number.
    -     Created a relational data source business layer using my data foundation
    -     In the business layer I click on the Queries tab and then the u201C+u201D to bring up the query panel
    I want to write a query that combines the data from DEV and QA and list all the contract numbers, their create date and a gross quantity field from both systems
    How do I write the query?
    Appreciate any help
    Mike...

    Whenever we are creating DataFoundation with Multi source Enabled, the data sources are not enabled. For single source it is working fine. we are doing it with SAP BO4.0 SP4 Client tools. How to reslove this issue..

  • Is there any better way of writing this query??

    I have a query on insert which looks like this,
    INSERT INTO TEMP( I1,I2)
    SELECT TI1 FROM CLIENT1
    WHERE R_CD ='PR' OR 'SR',
    SELECT TI2 FROM CLIENT2
    WHERE R_CD = 'MN' OR 'OP
    There are two tables where the source data is coming from and inserted into TEMP table. I find this query to be inefficient. Anybody who can help me writing a good one?? Thanks.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by [email protected]:
    I have a query on insert which looks like this,
    INSERT INTO TEMP( I1,I2)
    SELECT TI1 FROM CLIENT1
    WHERE R_CD ='PR' OR 'SR',
    SELECT TI2 FROM CLIENT2
    WHERE R_CD = 'MN' OR 'OP
    There are two tables where the source data is coming from and inserted into TEMP table. I find this query to be inefficient. Anybody who can help me writing a good one?? Thanks.<HR></BLOCKQUOTE>
    A possible solution,
    INSERT INTO TEMP( I1,I2)
    SELECT C1.TI1, C2.TI2
    FROM CLIENT1 C1, CLIENT2 C2
    WHERE (C1.R_CD = 'PR' OR C1.R_CD ='SR') AND
    (C2.R_CD = 'MN' OR C2.R_CD = 'OP')
    null

  • Writing query using UNION Operator

    Question -
    (1)
    Write an SQL Statement to list the following items: Customer ID, Customer Name, number of invoices, sum of total for invoices. Ensure that all customers are returned in the result set.
    Answer for the above is written as below by one person. That seams to be correct. Is there another way of writing this same query.;
    select c.CUSTOMER_ID,c.NAME,i.cnt,i.s
    from gee_customer c,(select customer_id,count(*) as cnt, sum(TOTAL) as s
    from gee_invoice
    group by customer_id) i
    where c.CUSTOMER_ID = i.customer_id (+)
    (2)
    My other question is How to write the above answer (or what you sugest) using UNION operator ?
    Any ideas please
    Message was edited by:
    user483578

    In fact the outer join means you use the union of two result sets - usual join result
    and the rows from the outer table for which there is not any row in the inner table.
    SQL> select d.deptno, e.ename from emp e, dept d
      2  where d.deptno = e.deptno(+)
      3  order by 1,2
      4  /
        DEPTNO ENAME
            10 CLARK
            10 KING
            10 MILLER
            20 ADAMS
            20 FORD
            20 JONES
            20 SCOTT
            20 SMITH
            30 ALLEN
            30 BLAKE
            30 JAMES
            30 MARTIN
            30 TURNER
            30 WARD
            40
    15 rows selected.
    SQL> select d.deptno,e.ename from emp e, dept d
      2  where d.deptno = e.deptno
      3  union
      4  select deptno, null
      5  from dept d where not exists (select null from emp e where e.deptno = d.deptno)
      6  order by 1,2
      7  /
        DEPTNO ENAME
            10 CLARK
            10 KING
            10 MILLER
            20 ADAMS
            20 FORD
            20 JONES
            20 SCOTT
            20 SMITH
            30 ALLEN
            30 BLAKE
            30 JAMES
            30 MARTIN
            30 TURNER
            30 WARD
            40
    15 rows selected.In your example something like (NOT tested !)
    with i as (select customer_id,count(*) as cnt, sum(TOTAL) as s
    from gee_invoice group by customer_id)
    select c.CUSTOMER_ID,c.NAME,i.cnt,i.s
    from gee_customer c, i
    where c.CUSTOMER_ID = i.customer_id
    union
    select c.CUSTOMER_ID,c.NAME,null,null
    from gee_customer c
    where not exists (select null from i where c.CUSTOMER_ID = i.customer_id)
    Rgds.

  • Modify query used in Materialized View

    Are there any ways to modify the query used in materialized view without dropping the materialized view. I dont think alter materialized view has such an option.
    Please provider me your suggestions.

    you have to give "ENABLE QUERY REWRITE" option then u can change your query

  • Is there another way

    Is there another way of exporting from iMovie using export to Quicktime instead of using the CD option which I use so that I can keep my related chapters so that they show up in Idvd when imported.
    Only problem is that the quality is bad and once the DVD is made it plays back in a DVD player in a slow motioned kind of way.
    If I use the export to Quicktime full quality settings I loose the chapter settings as they are not saved using this function and this function has better quality.

    You don't have to export any of your iMovie projects in order to place them into an iDVD project. And if you don't export, you won't take that quality hit that you've seen.
    Create as many iMovie projects as you'd like. In order to place then into one iDVD project, it is recommended that you keep the total length below 120 minutes. That length includes leaving time for the menus that play in your finished DVD, so leave a bit of wiggle room.
    When your iMovie projects are complete, Quit iMovie. Launch iDVD and create a new project. Consider which of the iMovies you want to be the dominant movie in your DVD - the one that plays first if the viewer selects "play movie." In iDVD, do File > Import...> Video and select that iMovie project. Your iMovie chapters will be retained and there will be no loss of quality.
    To add more movies to the iDVD project, use the little + in the lower left of the iDVD window. If you choose "Add Movie" you can import another iMovie project. It will add a button to your Menu, as well. If that movie has chapter markers, it will automatically get its own "scene selection" submenu based on those chapters.
    One thing to keep in mind is that in the final DVD each movie imported from a separate iMovie project will return to the Menu screen after it plays. There is no choice for "play all" where each movie plays in turn before going back to the menu. (If you wanted them to all play sequentially, you could have created them all with one iMovie project.)
    Another thing to keep in mind is to check the Map View of your iDVD project as you are working. With multiple movies, you might accidentally nest items that you wanted to place in parallel. That would result in a DVD that is difficult to navigate when viewing. That map also alerts you to missing items on your menus. When your project is finished, be sure to check the Project > Project Info window and be sure that everything checks out, especially the Project Duration. If total time is below 60 minutes you can encode using "Best Performance" and (ironically) you'll get the highest quality video. If the time is between 60 and 120 minutes you must switch the encoding setting to "Best Quality." The closer you get to 120 minutes, the more likely you are to see a degradation in video quality.
    Finally, to avoid surprises in your burned DVD, don't let iDVD do the actual burning. Instead, do File > Save as Disc Image. That lets iDVD do all the encoding, rendering, compressing. When done, you'll have a disc image file that you can preview in your DVD Player Application. If it plays properly, you can burn the disc image to DVD using Disk Utility or Toast. Reducing the speed of the burn to as slow as your media will allow can improve playability.
    Regards.

  • Can I put more than one user under one Apple ID account. I want to let other family members use imessage on their own Apple device. Or is there another way to get this end result?

    Can I put more than one user under one Apple ID account. I want to let other family members use imessage on their own Apple device. Or is there another way to get this end result?

    You can seach the net for solutions like this one http://appletvvpn.com/how-to-connect-apple-tv-2-to-vpn/ another idea is to use a PC as the control and fit that with a wireless card and set up a ad hoc wireless network that the Apple TV uses. 

  • The latest version of iTunes does not allow me to open a playlist in a separate window.  I need this feature.  Is there another way?  You used to be able to double click a playlist and have it appear in a new window.

    The latest version of iTunes does not allow me to open a playlist in a separate window.  I need this feature.  Is there another way?  You used to be able to double click a playlist and have it appear in a new window.

    Others have commented on this too.  It seems to be one of the 'improvements' of the newer version you are supposed to embrace with joy as an exciting new development.  You can send feedback to Apple but realize you may be perceived as standing in the path of  progress.
    http://www.apple.com/feedback/itunesapp.html

  • I lose my iphone but i turn off icloud how i can use ( find my phone )   or another way or software

    i lose my iphone but i turn off icloud >> how i can use ( find my phone )   or another way or another sofware to find my iphone
    please help me

    You have to have iCloud enabled and Find My iPhone set to On on your iPhone in order to find it.  If you're saying you turned this off before losing it I'm afraid you're out of luck.

  • I just bought photoshop elements 13 last night. Today I am watching tutorial videos to show me how to use it, but the videos are showing me things I don't have. Asking me to click on tabs i don't have. Why is this? Is there another way I can learn? Or is

    I just bought photoshop elements 13 last night. Today I am watching tutorial videos to show me how to use it, but the videos are showing me things I don't have. Asking me to click on tabs i don't have. Why is this? Is there another way I can learn? Or is my download messed up and not giving me everything I need?

    Got a link showing us which video tutorials you're watching and examples of what's missing in your software?

  • Using another database table in a query

    Hi,<BR><BR>Iam designing a report in which i have to use a table from another database<BR><BR>my query is <BR><BR>select ev_class_id,ev_id,desc,start_time from tev where start_time > today<BR><BR> and (desc like \'%f\' or desc like \'%m\' or desc like \'%yds\')<BR><BR> and ev_id not in(selct ev_id from ppbrio:race_length)<BR><BR> and ev_class_id = 23<BR><BR> union<BR><BR> select ev_class_id,ev_id,desc,start_time from tev where start_time > today<BR><BR> and ev_id not in (select ev_id from ppbrio:race_length)<BR><BR> and ev_class_id in (3,129,131,132)<BR><BR>"open bet" is a databse am using to design query and have to use a table from ppbrio(pp_race_length)<BR><BR>can some body tell me how to do this.<BR><BR>rajani<BR><BR><BR>

    Put it in the post-query trigger. Post-change is there only for backward compatibility.

  • How to create a notification for new virtual machines created on Hyper-v Using SCOM or another way?

    Hi ,
    We need to  to create a notification for new virtual machines created on Hyper-v Using SCOM or another way
    thanks

    http://sincealtair.blogspot.com/2010/04/how-to-ask-questions-in-technical-forum.html
    Not nearly enough information.
    If you are asking about SCOM, it is better to ask in the SCOM forum -
    http://social.technet.microsoft.com/Forums/en-US/home?forum=operationsmanagergeneral
    .:|:.:|:. tim

  • How can i activate iPhone without apple id ? It is used iphone 5 , ios 7 , no other information. May be i can do something with developer account ? another way?

    It is used iphone 5 , ios 7 , no other information. May be i can do something with developer account ? another way?

    That's the entire point of the update. To prevent unauthorized activation of an iPhone. To discourage Theft.
    If there was a way around it, it would defeat its purpose.
    The only way to get past that is to contact the original owner and ask that they remove the lock with their Apple ID.

Maybe you are looking for

  • How to get KB/s

    so I'm making a file transfer program (one computer to another) and I want the transfer speed to show up in KB/s. I'm using an ObjectOutputStream that sends a byte array, then an ObjectInputStream reads one byte at a time... It would probably work to

  • Printing black and white photos

    Re:  Deskjet 'All in One' F2180 Model CB597A / Windows XP When I print pictures that are grayscale and have deselected 'colour' and selected 'grayscale' in the printer properties, the photos print out mauve.  I have cleaned heads and tested colours a

  • Daily, successive kernel panics - how to identify root issue?

    A few weeks ago, my computer suffered from some water damage. I sent it to an Apple repair center where most of it was replaced, including the logic board, speakers, discrete GPU, and  I/O board. After using it for 2 days without issues, I installed

  • Cannot create ringtones in iTunes Store.

    Hi all... I just got an iPhone and setup/activation all went fine. Then I signed in to the iTunes store to buy some ringtones and it won't let me. I can see the bell icon on ringtone-eligible songs, but when I click it I get a page entitled "Learn mo

  • Not using iTunes to conect to computer

    Is there any other way to connect to the computer and manage iPod files (photos and music) without using iTunes?