I have one query using IN

can use exists instead of IN operator. or is there any optional to that query. please suggest me.
lakshman.

Yes you can, but it doesn't means that you will have a better performance, it depends on where is the predicate of your query.
If the selective predicate is in the subquery, then use IN. If the selective predicate is in the parent query, then use EXISTS.
Best Regards

Similar Messages

  • I have one query about table entries.

    i have one query about table entries.
    suppose  for particular table we maintained   5 entries in dev server. actaully in the dev we have only these 5 entries.
    In production we have 200 entries actually.
    If we move the cts from  dev  to production ,we will get 205 entries right
    please help me in this.

    If i understood correctly, It is a Z table and you have done some changes in DEV system. If you move this to Production, it wont effect the production entries.
    There are 2 different ways you can trnasport a Table. 1. with Table entries 2. Without table entries.
    If you transport with Table entries then the DEV entries in this case 5 will be moved to PRODUCTION totaling 205.
    If you transport without table entries, then in Production you will find only 200 entries.

  • How to update multiple rows in one query using php

    i am new to this can any one help me how to update multiple rows at a time i am doing an school attendance page

    Often the situation is such that you have multiple courses across a range of dates.So students may take more than one course, and you need to track attendance for each course date. The following graphic demonstrates this:
    In such a situation, you need four database tables as follows:
    students (student_id, student_name, etc.)
    courses (course_id, course_name, etc.)
    students_courses (student_id, course_id)
    attendance (student_id, course_id, dater)
    A fifth table may also be needed to define the dates of courses, but you may also be able to build this array programmatically by using PHP's robust date functions, which can give you, for instance, all the Tuesdays and Thursdays between a start date and end date.
    The students_courses table simply keeps track of which students are taking which courses, so it has just two columns for the primary keys of both of the main tables. The attendance table is similar, but it also includes a date field. The following view of the attendance table demonstrates this:
    So if David's solution does cover your needs, consider yourself lucky, because this could quickly grow from a beginner-appropriate project to a moderately advanced one.

  • Is it possible to have one library used between two users?

    Hello, I am setting up a friend's computer to have a seperate user for him and for his wife. The computer has been in use for about a year with just one user. Adding the second one makes sense for everything they use the computer for--except iPhoto. They have roughly 11,000 images in the library and want to be able to access, edit, export, etc them from whichever user is logged on. They would like it to work so that when one user adds images to the library, the other user has access to them as well. I looked into the sharing photos option, but it seems to restrict you to read only access when viewing shared libraries. Any suggestions on the best option for them? They are using a dual G5 Tower running iPhoto 5.0.4
    Thanks, Alan
    Powerbook 1.25 GHZ    

    Hey,
    saw this in macworld:
    (I haven't tried this, but it does indicate that permissions include read and write)
    Family Album
    My son and I share an iMac at home. Is there a way for us to use the same iPhoto library?—Kiki Mulliner
    With the proper privileges, this can be done with aliases. It works this way:
    Choose the most up-to-date iPhoto Library folder (located at your user folder/Pictures) and move it to the Shared folder inside the Users folder at the root level of the hard drive. Click on the iPhoto Library folder, press Command-I to call up the iPhoto Library Info window, click on the Ownership & Permissions triangle, and then click on the Details triangle below. Select Read & Write from the Access pop-up menu directly beneath the Group pop-up menu, select Read & Write from the Others pop-up menu, and then close the Info window. Hold down the Command and option keys and drag the iPhoto Library folder back to the Pictures folder to create an alias.
    Switch to your son’s user account, change the name of his iPhoto Library to something like iPhoto Library Old (in case you want to use this library again), open the Shared folder within the Users folder, and Command-option-drag that folder’s iPhoto Library folder to your son’s Pictures folder to create an alias.

  • ABAP query using logical database KDF is not populating custom fields

    Hi Experts ,
    I created two following queries
    1.       VENDORCATKDF – uses KDF logical database
    2.       VENDORCATLFA1 – uses table = LFA1
    I’m pulling the same information in both queries:
    ·         Vendor Number
    ·         Country
    ·         Vendor Name
    ·         Vendor Category  (custom fields added to LFA1)
    The results for the query that uses the logical database KDF is incorrect.  It doesn’t pull in the flag on the custom field LFA1-ZMRO.   Even though the logical database KDF is made up of the table LFA1 and has these fields. 
    Is there something that can be done – so that all of these “custom” category fields under LFA1 (such as LFA1-ZZMRO) – get pulled into queries – when we use the logical database KDF ?

    Hi,
    I have got the error removed by ensuring that fields from one table are a part of one line ( taking help of ruler) only. But the underlying problem remains, the output is not ALV but List output.
    I do not think having additional fields in the query is reason for this.
    Is it bcoz iI am adjusting the output length of columns to ensure no hierarchical error ?
    Can we not have a query using LDB which is shown as SAP List?
    Regards,
    Garima.

  • Running a  BEx report with more than one query in Background

    I am having a workbook with 2 queries .This workbook needs to be executed at a particular time every day and then save this file to a application server location .
    The file name has to dynamic, as everday a new file has to be created with some date stamp.
    Please let me know the steps/ ideas to achieve this

    Sudhakar,
    are you sure that it has to b a workbook ? running queries independently can be done .. am not sure if a workbook can be scheduled to run...
    One alternative is to use APD - have the queries run and populate two ODS and then have these ODS in a multiprovider and have one query output for the same - seems to be a very longworkaround...
    Another option is to have the queries executed in an ABAP programme and then have the results in an internal table and push both the result sets into an excel sheet ad save it in the application server.
    For reading queries in ABAP there is a functionmodule for the same .. something like RSDRI_INFOPROV_READ .. I am not too sure of the name but there is a function module for sure..
    Hope it helps..
    Arun
    Assign points if it helps..

  • Retrieving spatial and non spatial data in one query

    Hello. I am having slight difficulties using JDBC to retrieve both spatial and non spatial data in the same query. The following is code from a sample program of mine that retrives spatial data from spatial tables.
    (In spatialquery geom is a geometry column and city is simply the name of the city):
    try
    Geometry geom = null;
    String database = "jdbc:oracle:thin:@" + m_host + ":" + m_port + ":" + m_sid;
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    con = (OracleConnection)DriverManager.getConnection(database, sUsername, sPassword);
    GeometryAdapter sdoAdapter =
    OraSpatialManager.getGeometryAdapter("SDO", "8.1.7", STRUCT.class, null, null, con);
    String spatialquery = "SELECT a1.geom, a1.city \n" +
    "FROM cities a1";
    Statement stmt = con.createStatement();
    OracleResultSet rs = (OracleResultSet) stmt.executeQuery(spatialquery);
    int i = 0;
    int noOfFeatures = 2;
    while (rs.next())
    for(i = 1; i <= noOfFeatures; i++)
    STRUCT dbObject = (STRUCT)rs.getObject(i);
    try
    geom = sdoAdapter.importGeometry(dbObject);
    catch(GeometryInputTypeNotSupportedException e)
    System.out.println("Input Type not supported");
    catch(InvalidGeometryException e)
    System.out.println("Invalid geometry");
    System.out.println(geom);
    }//end while loop
    This retrieves the sptial data fine, however when I attempt to retreive the non-spatial data I keep getting a "ClassCastException" error. I understand it is something to do with "STRUCT dbObject = (STRUCT)rs.getObject(i);" line. Can anyone tell me how to retrieve both spatial and non-spatial data in the one query using JDBC. I have tried nearly everything at this stage. Cheers joe

    Theresa A Radke
    Posts: 20
    OTN Member Since: Jul, 2001
    retrieving spatial and non spatial in same query. May 23, 2003 12:02 AM
    retrieving spatial and non spatial in same query.

  • One query

    hi,
          i have one query regarding one scenario which demands automatic deliver of mail to concerned person whenever there is no stock available for any material in the system..My interest is to notify the warehouse incharge about the status of items whether it is being totally utilised so that proper and immediate action could take place...As soon as the material Qty becomes zero,this should happen...Please guide me briefly for the same...
    Thanks and Regards,
    Gaurav

    Gaurav,
    Instead of starting the workflow and checking the start condition. If you can find a UserExit/Badi/Ench., use that to validate the stock and if it satisfies then go ahead and start the workflow.. If it only a mail to the concerned person, you can even send a mail using function modules(SO_NEW_DOCUMENT_SEND_API1 or similar one) .
    Thanks,
    Sudhir.

  • BUSINESS QUERY (used in lower version of BO 6.x) to be migrated to LIVE OFFICE u2013

    Post Author: shikhirgupta
    CA Forum: Migration to XI R2
    We have  requirement in one of the project whereby they have BUSINESS QUERY (used in lower version of BO 6.x) to be migrated to LIVE OFFICE u2013 new product available in BOXI r2.
    This cannot be migrated as BusinessQuery is no longer supported.
    So we need to do a manual task of getting these Business query converted into Live office.
    Please provide me with a writeup stating, what are the challenges, what is the process for converting BusinessQueries to live office, effort required to do the same.

    Post Author: shikhirgupta
    CA Forum: Migration to XI R2
    We have  requirement in one of the project whereby they have BUSINESS QUERY (used in lower version of BO 6.x) to be migrated to LIVE OFFICE u2013 new product available in BOXI r2.
    This cannot be migrated as BusinessQuery is no longer supported.
    So we need to do a manual task of getting these Business query converted into Live office.
    Please provide me with a writeup stating, what are the challenges, what is the process for converting BusinessQueries to live office, effort required to do the same.

  • One Query need to tune

    I have one query below to tune.
    Here one table USER_RETAILER_MAP and its column BELONGS_TO having value only 'Y' and 'N'.
    Created bitmap index but i am not getting any cost difference.
    Please share your idea ,how to tune and what process should follow.
    SQL> explain plan for
    2 SELECT a.user_id,
    3 a.user_nm,
    4 2 AS max_level
    5 FROM gss_user a
    6 WHERE a.user_id NOT IN (SELECT user_id
    7 FROM user_retailer_map
    8 WHERE retailer_id IN (SELECT b.retailer_id
    9 FROM user_retailer_map b,
    10 retailer c
    11 WHERE
    12 b.retailer_id = c.retailer_id
    13 AND b.user_id = :a
    14 AND c.status = 'ACTIVE'
    15 AND b.managed_by = 'Y')
    16 AND belongs_to = 'Y')
    17 AND Upper(a.status) = 'ACTIVE'
    18 AND a.user_id IN (SELECT user_id
    19 FROM user_hierarchy
    20 WHERE parent_user_id = :b)
    21 AND a.gmac_dealer_user_flg = 'D'
    22 ORDER BY Upper(user_nm) ASC
    23 ;
    Explained.
    SQL> @utlxpls
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 1 | 91 | 65 |
    | 1 | SORT ORDER BY | | 1 | 91 | 65 |
    |* 2 | HASH JOIN ANTI | | 1 | 91 | 63 |
    | 3 | NESTED LOOPS SEMI | | 7 | 504 | 9 |
    |* 4 | TABLE ACCESS FULL | GSS_USER | 33 | 1254 | 9 |
    |* 5 | INDEX UNIQUE SCAN | XPKGSS_USER_HIERARCHY | 7 | 238 | |
    | 6 | VIEW | VW_NSO_1 | 212 | 4028 | 53 |
    |* 7 | HASH JOIN | | 212 | 15476 | 53 |
    |* 8 | HASH JOIN | | 15 | 675 | 9 |
    | 9 | TABLE ACCESS BY INDEX ROWID| USER_RETAILER_MAP | 15 | 420 | 4 |
    |* 10 | INDEX RANGE SCAN | INDX_USERID_MNGBY | 15 | | 1 |
    |* 11 | INDEX FAST FULL SCAN | INDX_RETAILE | 1594 | 27098 | 4 |
    |* 12 | TABLE ACCESS FULL | USER_RETAILER_MAP | 22885 | 625K| 43 |
    Predicate Information (identified by operation id):
    2 - access("A"."USER_ID"="VW_NSO_1"."$nso_col_1")
    4 - filter(UPPER("A"."STATUS")='ACTIVE' AND "A"."GMAC_DEALER_USER_FLG"='D')
    5 - access("A"."USER_ID"="USER_HIERARCHY"."USER_ID" AND "USER_HIERARCHY"."PARENT_USER
    _ID"=:Z)
    7 - access("USER_RETAILER_MAP"."RETAILER_ID"="B"."RETAILER_ID")
    8 - access("B"."RETAILER_ID"="C"."RETAILER_ID")
    10 - access("B"."USER_ID"=:Z AND "B"."MANAGED_BY"='Y')
    11 - filter("C"."STATUS"='ACTIVE')
    12 - filter("USER_RETAILER_MAP"."BELONGS_TO"='Y')
    }

    How to post a SQL statement tuning request...
    HOW TO: Post a SQL statement tuning request - template posting

  • Query using 0calmonth, to input the month range, data incorrect

    hi, experts,
    I have a query using 0CALMONTH in the filter, restricted the range value ( eg. 2009.01-2009.08 ),
    but the data in Bex Analyzer only 2009.08, doest not collect the cube data from 2009.01 to 2009.08.
    If restrict the single value (eg, 2009.02), the data is correct.
    I tried to restrict the key figure by 0CALMONTH and then tried using variables with an offset but it does not work as input is a month range.
    my bw support package13, basis sp12.
    thanks in advance,
    xwu.

    this issue solved by myself, there is a non-cumulative Key Figure.
    thanks,
    xwu.

  • How to use one query against multiple table and recieve one report?

    I have duplicate tables, (except for their names of course) with commodities prices. They have the same column headings, but the data is different of course. I have a query that gives me a certain piece of information I am looking for but now I need to run this query against every table. I will do this every day as well, to see if the buying criteria is met. There are alot of tables though (256). Is there a way to say run query in all tables and return the results in one place? Thanks for your help.

    hey
    a. the all 256 tables whuld be one big partitoned table
    b. you can use all_tables in order to write a select that will write the report for you:
    SQL> set head off
    SQL> select 'select * from (' from dual
      2  union all
      3  select 'select count(*) from ' || table_name || ' union all ' from a
      4  where table_name like 'DB%' AND ROWNUM <= 3
      5  union all
      6  select ')' from dual;
    select * from (
    select count(*) from DBMS_LOCK_ALLOCATED union all
    select count(*) from DBMS_ALERT_INFO union all
    select count(*) from DBMS_UPG_LOG$ union all
    remove the last 'union all', and tun the generated quary -
    SQL> set head on
    SQL> select * from (
      2  select count(*) from DBMS_LOCK_ALLOCATED union all
      3  select count(*) from DBMS_ALERT_INFO union all
      4  select count(*) from DBMS_UPG_LOG$
      5  );
      COUNT(*)
             0
             0
             0
    Amiel

  • How to use one query results in another query

    hi,
    in help.sap I have founded that using variable type replacement path I can use one query results in another query. It is wrote there that I have to choose query name results I want to get in variable definition but I do not know where.
    How I can do this?
    Result I want to get is:
    In one query I have material prices in another material quantities. I want to calculate inventory value (price * quantity). Moreover prices are on plant level, quantities on storage type level. Plant is atribute of storage type.
    Can I do this?
    Regards,
    Andrzej

    Hi Andrzej,
    please check out this thread: Set parameters values depending on other parameters
    I had a discussion about query results as input for another query in there.
    For creating a workbook, just click on the save button after you ran your query in the bex.
    Siggi
    Message was edited by: Siegfried Szameitat

  • How to use ONE query to find out tree structure?

    ID------------upperID----------Name------------------------isFolder
    1------------ 0---------- Folder
    1------------------------------------1
    2------------ 1------------ Folder 1- Sub
    Folder--------------------1
    3------------ 2------------
    Folder1-Item1-A--------------------------0
    4------------ 1------------ Folder 1- Sub
    Item-----------------------0
    Hi all, if I have a table like above to demonstrate the
    folders and item relationship. This structure allows the user to
    create unlimited folders and items.
    Now I would like to use one query to find out the tree
    structure of this table, how could I do the query.
    Any help on this will be highly appreciated!
    Thanks,
    ez

    Also, see this thread:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=7&threadid=12 55788&enterthread=y

  • Need to use the results of one query as an input to another query

    Hi, I have one sql query in my XML file, that returns more than one values for a column.
    and i want to use this output one by one as an input to the second query to retrive the data from the second query.
    Could please someone tell me if its possible in XML Publisher?
    If possible, please share the syntax to do the same
    For eg:
    Query 1:
    Select data1, data2 from query1 ; -- output data1 and data2
    want to use data1 and data2 one by one in the below query
    Query 2:
    select * from abc where name_id= data1/data2;
    Thanks and Regards
    Madhu

    Make sure your cursor declarations are in your declare section, not between the begin and end statements.

Maybe you are looking for

  • Hiding custom column in Weekly view of the Time Entry in ESS

    We have added a custom field to time entry (CAT2). This field is displaying in both (weekly and daily) view of the time entry screen in ESS. Our requirement is too display the field only in daily view. Is there a way to hide the custom column in the

  • Camera Raw not working/recognising CR2 files - CS5, Mac

    I cannot get Camera Raw to work. It worked before but took some fiddling around to get it to work. I am using CS5 on a Mac. My camera is supported by the version of Camera Raw I have and it is the latest update for CS5. Help please.

  • ITunes doesn't find photos in Photoshop Elements album

    I've used iTunes to sync several Photoshop Elements 6 albums to my ATV. There is one album that iTunes finds but it does not think there are any photos in it. When you go to the Photo tab on the ATV device in iTunes it searches for a few seconds and

  • How to run pm-util hook not as root?

    My mouse settings do not restore when waking up from sleep, so I need to issue "kcminit mouse." But if I run it with sudo -u user kcminit mouse I get No protocol specified kcminit: cannot connect to X server :0.0 Anyone have any other ideas to solve

  • Loading a movie on html from another server

    I have a question: I have a form on Flash and I want to make the swf file a part of a HTML page. Here is the(for me) tricky part: on Flash I use an external php-file to send the information back to me, but the server where the HTML page runs is an AS