Select one record for the first matching condition only in four where condi

I need your suggestion to write one tricky SQL query to select only one record from database on the following condition.I explained simple table structure below.I have a table temp with four columns a,b,c,d in it.
I have to select column d from this temp table based on the following four conditions.If it matches any condition, It should skip other conditions, that's the tricky thing.
Conditions order is like shown below.
1) a='argument1' and b='argument2' and c='argument3'(If it matches this condition, it should stop selecting below 3 conditions)
2) a='argument1' and b='argument2' and c='none'(If it matches this condition, it should stop selecting below 2 conditions)
3) a='argument1' and b='none' and c='argument3'(If it matches this condition, it should stop selecting below condition)
4) a='argument1' and b='none' and c='none'(this is last condition)
If I use OR operator , it matches all of those other conditions too.I never wrote query like this before.
I greatly appreciate if somebody sheds light on me to start writing this query with a simple suggestion.
Thanks,
GD

This forum might help you out, as they are experienced SQL developers, however, this forum is primarily for queries about the tool, SQL Developer. I recommend you post this on the SQL & PL/SQL forum where they focus on these queries:
PL/SQL
Sue

Similar Messages

  • Select one record per person from multiple conditions

    Perhaps been staring at this too long and making changes to try and gather the correct population, but can't seem to figure it out at the moment. Trying to determine logic to select one record per person. If person has more than one record would like to choose the record that matches the sequence priority which is:
    AND CASE WHEN ac.primary_program_ind = 'N'                                       --Existing Students who have a new program (Continuing Law and added Business)
                                   AND ac.academic_period_admitted = ac.academic_period
                                   AND ac.student_population <> 'V'
                                   AND ac.program is not null THEN 'Y'
                                WHEN ac.primary_program_ind = 'Y'                                        --Visitors (Each term considered new)
                                   AND ac.student_population = 'V'
                                   AND ac.academic_period_admitted is not null THEN 'Y'
                                WHEN ac.primary_program_ind = 'Y'                                        --Normal Cases
                                   AND ac.academic_period_admitted is not null THEN 'Y' --= ac.academic_period THEN 'Y'
                       END = 'Y' Meaning that if the person has records that meet more than one of the above cases, it should choose the record matching the First Case of the case statement. If the records do not meet the first case at all then look to see if it meets the second case and if it does choose that record, etc.
    Sample Data:
    SELECT 363 AS PERSON_UID, '1875' AS ID, '201140' AS ACADEMIC_PERIOD, '201040' AS ACADEMIC_PERIOD_ADMITTED, 'UG' AS STUDENT_LEVEL, '' AS EXIST_NEWPROG, 'Y' AS VISITORS, 'Y' AS NORMAL, 'V' AS STUDENT_POPULATION, 'Y' AS PRIMARY_PROGRAM_IND, 'LA' AS PROGRAM FROM DUAL
    UNION SELECT 852, '1962', '201130', '201040', 'GR', '', '', 'Y', 'C', 'Y', 'MS'  FROM DUAL
    UNION SELECT 852, '1962', '201140', '201140', 'GR', 'Y', '', '', 'G', 'N', 'MBA' FROM DUAL
    UNION SELECT 852, '1962', '201140', '201040', 'GR', '', '', 'Y', 'G', 'Y', 'MS' FROM DUAL
    UNION SELECT 659, '1093', '201140', '200840', 'UG', '', '', 'Y', 'T', 'Y', 'BB' FROM DUALSo for the above data on ID '1962', I would like to select the record that has EXIST_NEWPROG = 'Y' and ignore the other rows for that ID. Note:EXIST_NEWPROG, VISITORS, NORMAL I added to sample data, these cols don't actually exist. Put in for easier display purpose to show what case statements are doing. The actual sql statement has many joins and where statements, but hopefully this simplification of the sql will be sufficient to derive a solution.
    WITH MULTIROWS AS
    SELECT 363 AS PERSON_UID, '1875' AS ID, '201140' AS ACADEMIC_PERIOD, '201040' AS ACADEMIC_PERIOD_ADMITTED, 'UG' AS STUDENT_LEVEL, '' AS EXIST_NEWPROG, 'Y' AS VISITORS, 'Y' AS NORMAL, 'V' AS STUDENT_POPULATION, 'Y' AS PRIMARY_PROGRAM_IND, 'LA' AS PROGRAM FROM DUAL
    UNION SELECT 852, '1962', '201130', '201040', 'GR', '', '', 'Y', 'C', 'Y', 'MS'  FROM DUAL
    UNION SELECT 852, '1962', '201140', '201140', 'GR', 'Y', '', '', 'G', 'N', 'MBA' FROM DUAL
    UNION SELECT 852, '1962', '201140', '201040', 'GR', '', '', 'Y', 'G', 'Y', 'MS' FROM DUAL
    UNION SELECT 659, '1093', '201140', '200840', 'UG', '', '', 'Y', 'T', 'Y', 'BB' FROM DUAL
    select *
    from multirows ac
    where  CASE WHEN ac.primary_program_ind = 'N'                                       --Existing Students who have a new program (Continuing Law and added Business)
                                   AND ac.academic_period_admitted = ac.academic_period
                                   AND ac.student_population <> 'V'
                                   AND ac.program is not null THEN 'Y'
                                WHEN ac.primary_program_ind = 'Y'                                        --Visitors (Each term considered new)
                                   AND ac.student_population = 'V'
                                   AND ac.academic_period_admitted is not null THEN 'Y'
                                WHEN ac.primary_program_ind = 'Y'                                        --Normal Cases
                                   AND ac.academic_period_admitted is not null THEN 'Y' --= ac.academic_period THEN 'Y'
                       END = 'Y'

    Hi,
    user1069723 wrote:
    Thanks Frank. I've been incorporating your solution and going over the data, (which is why it has taken so long to respond) and am getting closer, however the approach you provided excludes people who have a "RNum" of 2 or 3, but do not have a 1 at all. So people that only have a 2 and 3 OR only have a 2 or only have a 3 would not be captured, but if there is only one record, they would be missed.
    Here is another set of records of one person.
    SELECT 921 AS PERSON_UID, '8284' AS ID, '201130' AS ACADEMIC_PERIOD, '201030' AS ACADEMIC_PERIOD_ADMITTED, 'UG' AS STUDENT_LEVEL, '' AS EXIST_NEWPROG, 'Y' AS VISITORS, 'Y' AS NORMAL, 'V' AS STUDENT_POPULATION, 'Y' AS PRIMARY_PROGRAM_IND, 'LA' AS PROGRAM FROM DUAL
    UNION SELECT 921, '8284', '201140', '201040', 'UG', '', '', 'Y', 'F', 'Y', 'BB'  FROM DUAL
    Sorry, I can't reproduce the problem.
    If I add the two new rows of sample data that you posted today to the data you posted yesterday, then the query I posted yesterday produces:
    PERSON_UID ID   ACADEM ACADEM ST E V N S P PRO      R_NUM
           659 1093 201140 200840 UG     Y T Y BB           1
           363 1875 201140 201040 UG   Y Y V Y LA           1
           852 1962 201140 201140 GR Y     G N MBA          1
           921 8284 201130 201030 UG   Y Y V Y LA           1Io you get the correct output for the original ids?
    If I DELETE all the rows where id != 8284 I still get the same results for id=8284.
    'm using Oracle 11.1.0.6.0. What version are you running?
    Post your exact code, even iof you think you copied it from thsi site without any changes. Perhaps there was some subtle eidting mistake.
    I would like to select the record for Academic_Period = 201140 for this person. Is the problem that you're getting the wrong row for id=8284, or that you're not getting any output for id=8284?
    Why would you want to get the row with academic_period=201140? (Let's call this row A.) Why don't you want the other row for that person, the one with academic_period=201130? (Let's call this row B.) On both of those rows, primary_program_ind='Y' and academic_period_admitted is not NULL. The only significant difference between those two rows is that student_population='F' on row A, and it's 'V' on row B. Doesn't that mean that row B causes the CASE expression to return 3 ("Normal Case"), while row B makes it return 2 ("Visitor")? Doesn't that mean row B should be preferred to row A?
    Then again, perhaps this is just what you mean by saying that "term" is the main factor in deciding which row to select, and that the CASE expreesion ("New Program" before "Visitors", followed by "Normal Cases") is just a tie-breaker.
    Based on my understanding of the code you provided, this person is being excluded altogether because they do not have a record that evaluates to rnum = 1.ROW_NUMBER never returns a value of 2 or 3 unless it has already returned a value of 1. (At least that's how it's supposed to work, and I've never heard of any bugs concerning it.)
    This record is also complicated because it has two terms, Does "term" mean "academic_period" here?
    in all cases, we would want to select the highest term and then if there is still more than one qualifying record, base the "tie breaker" on the cases. Does this make sense or is my explanation still unclear?It's unclear.
    Maybe you need to add one more line at the beginning of the analytic ORDER BY clause (the 6th line below):
    WITH     got_r_num     AS
         SELECT     m.*
         ,     ROW_NUMBER () OVER ( PARTITION BY  id
                             ORDER BY       
                                             academic_period     DESC,          -- Added
                                             CASE
                                       WHEN  primary_program_ind      = 'N'     --Existing Students who have a new program (Continuing Law and added Business)
                                                       AND   academic_period_admitted      = academic_period
                                                       AND   student_population       != 'V'
                                                       AND   program                is not null
                                            THEN 1
                                                    WHEN  primary_program_ind      = 'Y'     --Visitors (Each term considered new)
                                                       AND   student_population      = 'V'
                                                       AND   academic_period_admitted is not null
                                            THEN 2
                                                    WHEN  primary_program_ind      = 'Y'     --Normal Cases
                                                   AND   academic_period_admitted is not null
                                            THEN 3
                                             END
                           )     AS r_num
         FROM     multirows     m
    --     WHERE     ...     -- If you need any filtering, this is where it goes
    SELECT     *     -- or list all columns except r_num
    FROM     got_r_num
    WHERE     r_num     = 1
    ;

  • Select one record for each member of the group

    Hi,
    am having a table where in i will be having data for so many group members. i need to fetch data for a particular group members whose number of rows of data may be more in numbers (but i want only one row of data for each member of the group)
    here is the query for fetching all rows of data
    select RI.RESOURCE_NAME,TR.MSISDN,TR.ADDRESS1_GOOGLE, TR.MSG_DATE_INFO, FROM TRACKING_REPORT TR, RESOURCE_INFO RI
    WHERE TR.MSISDN IN (SELECT MSISDN FROM RESOURCE_INFO WHERE GROUP_ID ='1' AND COM_ID=2 ) AND RI.MSISDN=TR.MSISDN
    order by MSG_DATE_INFOoutput of this query is...
    >
    ddd     12345          13-Mar-10 19:43:03
    eee     54321     Tamil Nadu, India      13-Mar-10 19:39:48
    ddd     12345          13-Mar-10 19:32:58
    eee     54321     Tamil Nadu, India      13-Mar-10 19:30:07
    ddd     12345          13-Mar-10 19:23:08
    eee     54321     Tamil Nadu, India      13-Mar-10 19:20:14
    fff     98765          13-Mar-10 19:19:22
    ddd     12345          13-Mar-10 19:13:01
    eee     54321     Tamil Nadu, India      13-Mar-10 19:09:50
    ddd     12345          13-Mar-10 19:02:56
    eee     54321     tn,ind      13-Mar-10 18:59:49
    ddd     12345          13-Mar-10 18:53:08
    eee     54321     tn,ind      13-Mar-10 18:49:50
    ddd     12345          13-Mar-10 18:42:56
    eee     54321     tn,ind      13-Mar-10 18:39:50
    ddd     12345          13-Mar-10 18:33:00
    eee     54321     tn,ind      13-Mar-10 18:29:50
    ddd     12345          13-Mar-10 18:22:54
    eee     54321     tn,ind      13-Mar-10 18:19:50
    ddd     12345          13-Mar-10 18:12:56
    eee     54321     tn,ind      13-Mar-10 18:09:50
    ddd     12345          13-Mar-10 18:02:54
    eee     54321     tn,ind      13-Mar-10 18:00:02
    fff     98765     Tamil Nadu, India      13-Mar-10 17:59:26
    fff     98765     Tamil Nadu, India      13-Mar-10 17:54:26
    ddd     12345          13-Mar-10 17:52:56
    eee     54321     tn,ind      13-Mar-10 17:49:50
    fff     98765     Tamil Nadu, India      13-Mar-10 17:49:25
    fff     98765     Tamil Nadu, India      13-Mar-10 17:44:26
    ddd     12345          13-Mar-10 17:42:56
    >
    from this output i want only one latest record for each member(ddd,eee,fff). i.e
    >
    ddd     12345          13-Mar-10 19:43:03
    eee     54321     Tamil Nadu, India      13-Mar-10 19:39:48
    fff     98765          13-Mar-10 19:19:22
    >
    how to modify the query to achieve this...?

    Hi,
    This is not giving the result which i want...
    table is
    CREATE TABLE TRACKING_REPORT
      ID               NUMBER,
      MSISDN           NUMBER(12)                   NOT NULL,
      X                NUMBER(15,8)                 NOT NULL,
      Y                NUMBER(15,8)                 NOT NULL,
      TIME_STAMP       DATE,
      MSG_DATE_INFO    DATE                         DEFAULT sysdate,
      ADDRESS1_GOOGLE  VARCHAR2(400 BYTE),
      ADDRESS2_GOOGLE  VARCHAR2(400 BYTE),
      ADDRESS_MLINFO   VARCHAR2(400 BYTE),
      REQ_ID           VARCHAR2(30 BYTE)
    CREATE TABLE RESOURCE_INFO
      RESOURCE_ID    NUMBER,
      MSISDN         NUMBER,
      RESOURCE_NAME  VARCHAR2(25 BYTE),
      ADDRESS        VARCHAR2(100 BYTE),
      COM_ID         VARCHAR2(20 BYTE),
      ADMIN_ID       NUMBER,
      TIME_STAMP     DATE                           DEFAULT SYSDATE,
      GROUP_ID       NUMBER
    )

  • Select Max record for the report

    Post Author: ROMZILBER
    CA Forum: WebIntelligence Reporting
    Hello,
    Here is our problem we have history data on a table like
    Example
    Data:
    11111   bbb       12/31/2004
    11111   nnn       12/31/2005
    11111   ddd       12/31/2007
    On a report we only need to display the most current record (based on a date).
    11111   ddd       12/31/2007
    How can we do that, we have try to create subquery but it does not allowed to enter logic for the max date for the same id.  So we are kind of stuck, I am more then sure this would be a very common conditions specially for data warehousing.
    we are on Oracle 10g
    Thank you for all your help.

    Post Author: ROMZILBER
    CA Forum: WebIntelligence Reporting
    To create a view is not a problem, supporting it is a different story
    But we have find a solution, you were correct about the filter.  I just did not know you can put the whole subselect in a  filter
    but here is a logic for the filter if someone would come up with the same problem
    tablename.NNNN_PROOF_DT = (SELECT MAX(X.NNNN_PROOF_DT) FROM tablename X  WHERE tablename.NNNN_CLAIM_NUMBER = X.NNNN_CLAIM_NUMBER AND   tablename.NNNN_LINE_CD = X.NNNN_LINE_CD)
    please let me know if you have any questions.
    sorry I am new to this so please do not take any offense

  • DB_GET_BOTH_RANGE fails when there is only one record for a key

    Using the DB_GET_BOTH_RANGE flag doesn't seem to work when there is a
    single record for a key.
    Here's a sample Python program that illustrates the problem. If you
    don't know Python, then consider this to be pseudo code. :)
    from bsddb3 import db
    import os
    env = db.DBEnv()
    os.mkdir('t')
    env.open('t',
    db.DB_INIT_LOCK | db.DB_INIT_LOG | db.DB_INIT_MPOOL |
    db.DB_INIT_TXN | db.DB_RECOVER | db.DB_THREAD |
    db.DB_CREATE | db.DB_AUTO_COMMIT)
    data = db.DB(env)
    data.set_flags(db.DB_DUPSORT)
    data.open('data', dbtype=db.DB_HASH,
    flags=(db.DB_CREATE | db.DB_THREAD | db.DB_AUTO_COMMIT |
    db.DB_MULTIVERSION),
    txn = env.txn_begin()
    #data.put('0', '6ob 0 rev 6', txn)
    data.put('0', '7ob 0 rev 7', txn)
    #data.put('0', '8ob 0 rev 8', txn)
    data.put('1', '9ob 1 rev 9', txn)
    txn.commit()
    cursor = data.cursor()
    print cursor.get('0', '7', flags=db.DB_GET_BOTH_RANGE)
    cursor.close()
    data.close()
    env.close()
    This prints None, indicating that the record who's key is '0' and
    who's data begins with '7' couldn't be found. If I uncomment wither of
    the commented out puts, so that there is more than one record for the
    key, then the get with DB_GET_BOTH_RANGE works.
    Is this expected behavior? or a bug?

    You can use the DB_SET flag which will look for an exact key match. If
    you use it with the DB_MULTIPLE_KEY flag, it will return multiple keys
    after the point it gets a match. If you can post here how all your
    LIKE QUERIES look, I may be able to provide you with the suited
    combination of the flags you can use for them.I'm not doing like queries. I'm using BDB as a back end for an object
    database. In the object database, I keep multiple versions of object
    records tagged by timestamp. The most common query is to get the
    current (most recent version) for an object, but sometimes I want the
    version for a specific timestamp or the latest version before some
    timestamp.
    I'm leveraging duplicate keys to implement a nested mapping:
    {oid -> {timestamp -> data}}
    I'm using a hash access method for mapping object ids to a collection
    of time stamps and data. The mapping of timestamps to data is
    implemented as duplicate records for the oid key, where each record is
    an 8-byte inverse timestamp concatenated with the data. The inverse
    timestamps are constructed in such a way that they sort
    lexicographically in inverse chronological order. So there are
    basically 3 kinds of query:
    A. Get the most recent data for an object id.
    B. Get the data for an object id and timestamp.
    C. Get the most recent data for an object id who's timestamp is before
    a given timestamp.
    For query A, I can use DB->get.
    For query B, I want to do a prefix match on the values. This can be
    thought of as a like query: "like <inverse-time-stamp>%", but it can
    also be modelled as a range search: "get the smallest record that is >=
    a given inverse time stamp". Of course, after such a range search,
    I'd have to check whether the inverse time stamp matches.
    For query C, I really want to do a range search on the inverse time
    stamp prefixes. This cannot be modelled as a like query.
    I could model this instead as {oid+timestamp -> data}, but then I'd
    have to use the btree access method, and I don't expect that to scale
    as I'll have hundreds of millions of objects.
    We tried using BDB as a back end for our database (ZODB) several years
    ago and it didn't scale well. I think there were 2 reasons for
    this. First, we used the btree access method for all of our
    databases. Second, we used too many tables. This time, I'm hoping that
    the hash access method and a leaner design will provide better
    scalability. We'll see. :)
    If you want to start
    on a key partial match you should use the DB_SET_RANGE flag instead of
    the DB_SET flag.I don't want to do a key partial match.
    Indeed, with DB_GET_BOTH_RANGE you can do partial
    matches in the duplicate data set and this should be used only if you
    look for duplicate data sets.I can't know ahead of time whether there will be duplicates for an
    object. So, that means I have to potentially do the query 2 ways,
    which is quite inconvenient.
    As you saw, the flags you can use with cursor.get are described in
    detailed here.But it wasn't at all clear from the documentation that
    DB_GET_BOTH_RANGE wouldn't work unless there were duplicates. As I
    mentioned earlier, I think if this was documented more clearly and
    especially of there was an example of how one would work around the
    behavior, someone would figure out that behavior wasn't very useful.
    What you should know is that the usual piece of
    information after which the flags are accessing the records, is the
    key. What I advice you is to look over Secondary indexes and Foreign
    key indexes, as you may need them in implementing your queries.I don't see how secondary indexes help in this situation.
    BDB is
    used as the storage engine underneath RDBMS. In fact, BDB was the
    first "generic data storage library" implemented underneath MySQL. As
    such, BDB has API calls and access methods that can support any RDBMS
    query. However, since BDB is just a storage engine, your application
    has to provide the code that accesses the data store with an
    appropriate sequence of steps that will implement the behavior that
    you want.Yup.
    Sometimes you may find it unsatisfying, but it may be more
    efficient than you think.Sure, I just think the notion that DB_GET_BOTH_RANGE should fail if
    the number of records for a key is 1 is rather silly. It's hard for me
    to imagine that it would be less efficient to handle the non duplicate
    case. It is certainly less efficient to handle this at the application
    level, as I'm likely to have to implement this with multiple database
    queries. Hopefully, BDB's cache will mitigate this.
    Thanks again for digging into this.
    Jim

  • Merging two records in a single record for the same matnr,werks and bwart.

    Hi I have a requirement to merge two records into one single record using the quantity field from MSEG table.
    I am selecting two records from the table MSEG. Now for these two records i have to add the quantity values into one variable.
    Then there should be only one record for the same matnr,werks,bwart.
    Any suggestion would be appreciated.
    Regards,
    Amit

    hi,
    You can COLLECT statement only if all non key fields are numeric.
    This statement Adds all such fields and give us a single record.
    Regards
    Sumit Agarwal

  • My Effect preset only animates for the first 5 seconds....

    Greetings-
    (After Effects CS5, Mac OSX)
    I have a comp that is two minutes long. I dropped a preset effect ("Indigestion", in this case, but others produce the same result as well) onto a solid layer. The effect will animate for the first five seconds only, after that it remains static. There appears to be keyframe markers between the zero and five second mark. Why doesn't it animate for the entire duration of the clip? And, why does it decide to place keyframe markers at these points?
    Thanks-

    An effect preset simply adds keyframe and expressions to your layer. If you want the effect to last longer adjust the position of the keyframes.
    These are basic concepts. Are you new to AE? If so please go through the Getting Started documents found here.

  • I have an iPhone 4 and plugged it into itunes on my computer for teh first time. Only to discover my sister has obviously plugged hers into my itunes account and now I have lost all my photos and numbers. Please help me!!

    I have an iPhone 4 and plugged it into itunes on my computer for the first time. Only to discover my sister has obviously plugged hers into my itunes account and now I have lost all my photos and numbers. Please help me!!

    It can't do that by itself. You had to click through several prompts telling it to restore it from a backup of an old phone for that to happen.
    If the phone was not backed up to iCloud before this happened, or to another computer, then the data is gone. There is no way to recover it.

  • TS1424 Purchased an album one or more records does not play all the way through. A 13 minute track only plays for the first 3.05 minutes and then stops and the program locks up. Larry

    I just purchased a album and one or more of the tracks does not play all the way through. One track which is a 13 minute track will only play for the first 3 minutes. Larry

    Delete the songs from your iTunes library and redownload them by clicking "Purchased", under Quick Links at the top right of the iTunes store.
    Download past purchases:
    http://support.apple.com/kb/HT2519
    If this doesn't work contact iTunes support here:
    http://www.apple.com/support/itunes/contact/

  • Select statement is taking lot of time for the first time Execution.?

    Hi Experts,
    I am facing the following issue. I am using one select statement to retrieve all the contracts from the table CACS_CTRTBU according to FOR ALL ENTRIES restriction.
    if p_lt_zcacs[] is not initial.
    SELECT
               appl ctrtbu_id version gpart
               busi_begin busi_end tech_begin tech_end
               flg_cancel_obj flg_cancel_vers int_title
             FROM cacs_ctrtbu INTO TABLE lt_cacs FOR ALL ENTRIES IN p_lt_zcacs
                                                    WHERE
                                                    appl EQ gv_appl
                                                    AND ctrtbu_id EQ p_lt_zcacs-ctrtbu_id
                                                    AND  ( flg_cancel_vers EQ '' OR version EQ '000000' )
                                                    AND flg_cancel_obj EQ ''
                                                    AND busi_begin LE p_busbegin
                                                    AND busi_end GT p_busbegin.
    endif.
    The WHERE condition is in order with the available Index. The index has  APPL,CTRTBU_ID,FLG_CANCEL_VERS and FLG_CANCEL_OBJ.
    The technical settings of table CACS_CTRTBU says that the "Buffering is not allowed"
    Now the problem is , for the first time execution of this select statement, with 1.5 lakh entries in P_LT_ZCACS table, the select statement takes 3 minutes.
    If I execute this select statement again, in another run with Exactly the same parameter values and number of entries in P_LT_ZCACS ( i.e 1.5 lakh entries), it gets executed in 3-4 seconds.
    What can be the issue in this case? Why first execution takes longer time?.. Or is there any way to modify the Select statemnt to get better performance.
    Thanks in advance
    Sreejith A P

    Hi,
    >
    sree jith wrote:
    > What can be the issue in this case? Why first execution takes longer time?..
    > Sreejith A P
    Sounds like caching or buffering in some layer down the i/o stack. Your first execution
    seems to do the "physical I/O" where your following executions can use the caches / buffers
    that are filled by your first exectution.
    >
    sree jith wrote:
    > Or is there any way to modify the Select statemnt to get better performance.
    > Sreejith A P
    If modifying your SELECTS statement or your indexes could help depends on your access details:
    does your internal table P_LT_ZCACS  contain duplicates?
    how do your indexes look like?
    how does your execution plan look like?
    what are your execution figures in ST05 - Statement Summary?
    (nr. of executions, records in total, total time, time per execuiton,  records per execution, time per record,...)
    Kind regards,
    Hermann

  • I plugged my iphone 4S into my computer for the first time and then my photos were replaced with the ones from my old iphone, how do i get them back?

    i plugged my iphone 4S into my computer for the first time and then my photos were replaced with the ones from my old iphone, how do i get them back?

    Try restoring from the backup created at the beginning of the sync process:
    Without connecting your phone, open iTunes, go to Preferences, on the Devices tab check "Prevent...from syncing automatically"
    Connect your phone, right-click on the name of your phone when it appears on the left sidebar in iTunes
    Select Restore from backup, choosing your most recent backup to restore from
    Disconnect your phone and confirm that your photos are back
    Go back to iTunes>Preferences>Devices and re-enable automatic syncing.

  • How does one get to use their apple id for the first time?

    I registered for an Apple ID, which was successsful, but i can't seem to use it, because everytime i try to use it on iTunes it says I have never used this account before, and directs me to the review option which i select but it does the same thing all over again and I can't upgrade to the latest version, because System Preference is failing to open when I try to open the **** thing

    Hi RegoAntony,
    I apologize, I'm a bit unclear on the exact nature of what you are describing. If you are trying to use your Apple ID for the first time in the iTunes Store, you may find the following article helpful:
    Using an existing Apple ID with the iTunes Store, Mac App Store, and iBooks Store
    Regards,
    - Brenden

  • I plugged my iphone in for the first time to my itunes account and it now reads that this device is already  associated with an apple id.  what does that mean.  i only have one apple id. and do i chose cancel or transfer?

    i plugged my iphone in for the first time to my itunes account and it now reads that this device is already  associated with an apple id.  what does that mean.  i only have one apple id. and do i chose cancel or transfer?

    Hello there, Shellywms09.
    The following Knowledge Base article points out why you are receiving that message on your iPad:
    iTunes Store: Associating a device or computer to your Apple ID
    http://support.apple.com/kb/ht4627
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro

  • I have ad Apple ID on my iPad , when I use the apple on my iPhone for the first time, I put in my Apple ID for the iPad, didn't work. Need to create a new one. Why? How can I just use my iPad ID on my iPhone?

    I have ad Apple ID on my iPad , when I use the apple on my iPhone for the first time, I put in my Apple ID for the iPad, didn't work. Need to create a new one. Why? How can I just use my iPad ID on my iPhone?

    Hi kamfong,
    Went to Settings where?
    If you want to use your exisiting Apple ID on your iPad, you need to:
    1.     Go to Settings>iTunes & App Store and sign out the new ID, and then sign on the old one
    2.     Go to Settings>iCloud, scroll to the bottom and delete the iCloud account, and the sign back onto iCloud using the old ID
    You still have not indindated why you are saying that using your old ID originally "didn't work". What do you mean by that? Did you get some sort of error when you tried to sign on with your exisiting Apple ID?
    Cheers,
    GB

  • How do I accept the Terms and Conditions when trying to set up an Apple ID for the first time ( using my iphone)?

    I am trying to create an Apple ID by using the Itunes icon on my iphone 5s for the first time. It opens up a screen with the 54 pages of Terms and Conditions and it does not allow me to even accept the Terms and Conditions... no Accept option or place to click!
    The only option is to Send the terms and conditions via email... which also does not work...it keeps asking me to "try again"... Has someone else had this problem?

    Hello, Wyseup. 
    Thank you for visiting Apple Support Communities.
    Most likely this email address has been attempted to be setup as an Apple ID at some point.  You can reset your Apple ID password via the steps in the first article below.  If you do not have access to the email account, need assistance or are not receiving the password reset link, see the second article.
    Apple ID: If you forget your password
    http://support.apple.com/kb/ht5787
    Apple ID: Contacting Apple for help with Apple ID account security
    http://support.apple.com/kb/HT5699
    Cheers,
    Jason H.

Maybe you are looking for