Retreving the selected substring records from existing records.

Hi all,
SQL> select * from temp;
C1 C2
1 abcdef
2 efbcda
3 axyz
4 abedcd
I would like to retrieve only the records which have substring 'CD' from the available records..
Any help.
Regards,
~ sri

Will the "cd" be fixed - i.e. is it always 'cd' you're looking for?
If so, a function-based index on INSTR(c2,'cd') might help, then your query could be
where INSTR(c2,'cd') > 0
and use the index.

Similar Messages

  • How can we get the selected line number from JTextArea ?

    how can we get the selected line number from JTextArea ? and want to insert line/string given line number into JTextArea??? is it possible ?

    Praitheesh wrote:
    how can we get the selected line number from JTextArea ?
    textArea.getLineOfOffset(textArea.getCaretPosition());
    and want to insert line/string given line number into JTextArea??? is it possible ?
    int lineToInsertAt = 5; // Whatever you want.
    int offs = textArea.getLineStartOffset(lineToInsertAt);
    textArea.insert("Text to insert", offs);

  • My Lr is asking me to "delete the selected master photo from disk,or just remove it from Lr" I haven't selected any photos ,I just turned on Lr

    MY Lr is not responding to any process due to the following: Lr is asking " Delete the selected master photo from disk,or just remove it from Lr" the options are delete from disk,remove,cancel. Cancel doesn't work the other two options are deleting my photos which is not what it's required.

    Yes it is but a good idea to backup your computer once in awhile

  • Simplify the select query to get single record

    Please let me know what is wrong with my query.
    Max(p_received_date) is returning null columns too. But i need to have only null record per period, if there is date and null record for the same billing then return the date record. please check november and september records. september should return only 09/13/10 record but it is returning null record too. please help to get expected out put.
    SELECT DISTINCT B_BILLING_KEY,
    to_char(to_date('01/'||trim(substr(B_REPORT_PERIOD,5,2))||'/'||
    trim(substr(B_REPORT_PERIOD,1,4)),'DD/MM/YYYY'),'Month YYYY') Billing,
    B_company_id company,
    sum((nvl(T.B_ORG_SURCH_AMOUNT,0)+nvl(T.B_ORG_PI_AMOUNT,0))-(nvl(T.P_AMOUNT,0))) "PeriodBalance",
    Max(to_char(P_RECEIVED_DATE,'MM/DD/YY')) LastPaymentDate,
    decode(sign(
    (nvl(T.B_ORG_SURCH_AMOUNT,0)+nvl(T.B_ORG_PI_AMOUNT,0))-(nvl(T.P_AMOUNT,0))), 1,'Yes','No') Outs
    FROM mv_program_dict P, tuff_balance_view T WHERE
    b_company_id = 'U-7052-C' group by B_REPORT_PERIOD,B_company_id,B_BILLING_KEY,B_ORG_SURCH_AMOUNT,
    B_ORG_PI_AMOUNT,P_AMOUNT
    order by B_BILLING_KEY desc
    Actual
    Billing key Billing company periodbalance lastpayment date outs
    110631534073 November 2010 U-7052-C 270 Yes
    110631534073 November 2010 U-7052-C 690 Yes
    110631534073 November 2010 U-7052-C 66 Yes
    110461533197 October 2010 U-7052-C 4740 Yes
    110461533197 October 2010 U-7052-C 27000 Yes
    110461533197 October 2010 U-7052-C 0 No
    110251532527 September 2010 U-7052-C 0 09/13/10 No
    110251532527 September 2010 U-7052-C 0 No
    110251532527 September 2010 U-7052-C -18 09/13/10 No
    110251532484 August 2010 U-7052-C 0 09/13/10 No
    110251532484 August 2010 U-7052-C 2001 09/13/10 Yes
    110251532484 August 2010 U-7052-C 0 No
    Expectedoutput(need only following columns)Outs is outstanding balance
    Billing key Billing company l astpayment date outs
    110631534073 November 2010 U-7052-C Yes
    110461533197 October 2010 U-7052-C Yes
    110251532527 September 2010 U-7052-C 09/13/10 No
    110251532484 August 2010 U-7052-C 09/13/10 YES
    By using below query i am getting all output as NO. HOw to modify this query.
    SELECT company,
    billing,LastPaymentDate,
    CASE
    WHEN SUM (DECODE (outs, 'YES', 1, 0)) > 0 THEN 'YES'
    ELSE 'NO'
    END Outstanding
    FROM (
    SELECT DISTINCT B_BILLING_KEY,
    to_char(to_date('01/'||trim(substr(B_REPORT_PERIOD,5,2))||'/'||
    trim(substr(B_REPORT_PERIOD,1,4)),'DD/MM/YYYY'),'Month YYYY') Billing,
    B_company_id company,
    sum((nvl(T.B_ORG_SURCH_AMOUNT,0)+nvl(T.B_ORG_PI_AMOUNT,0))-(nvl(T.P_AMOUNT,0))) "PeriodBalance",
    Max(to_char(P_RECEIVED_DATE,'MM/DD/YY')) LastPaymentDate,
    decode(sign(
    (nvl(T.B_ORG_SURCH_AMOUNT,0)+nvl(T.B_ORG_PI_AMOUNT,0))-(nvl(T.P_AMOUNT,0))), 1,'Yes','No') Outs
    FROM mv_program_dict P, tuff_balance_view T WHERE
    b_company_id = 'U-7052-C' group by B_REPORT_PERIOD,B_company_id,B_BILLING_KEY,B_ORG_SURCH_AMOUNT,
    B_ORG_PI_AMOUNT,P_AMOUNT
    order by B_BILLING_KEY desc)
    GROUP BY company, billing,LastPaymentDate;
    Note:in the actual out put max(lastpayment date) is returing null values. if there is any date in one billing return that date only remove null example is september. in september it should return only 09/13/10 this date not null date. but if there is no other within one biling then consider that as null example november..
    Thanks,
    v

    Another solution is setting NLS_SORT to CI - case insensitive (or whatever_your_language_is_CI) and NLS_COMP to ANSI:
    SQL> with t as (
      2             select 'HARI' name from dual union all
      3             select 'Hari' name from dual union all
      4             select 'HaRi' name from dual
      5            )
      6  select  *
      7    from  t
      8    where name = 'hArI'
      9  /
    no rows selected
    SQL> alter session set nls_sort = binary_ci
      2  /
    Session altered.
    SQL> alter session set nls_comp=ansi
      2  /
    Session altered.
    SQL> with t as (
      2             select 'HARI' name from dual union all
      3             select 'Hari' name from dual union all
      4             select 'HaRi' name from dual
      5            )
      6  select  *
      7    from  t
      8    where name = 'hArI'
      9  /
    NAME
    HARI
    Hari
    HaRi
    SQL> SY.

  • How to create a LookUp field, selecting a value from another record type ??

    Hello all,
    I am looking to create a new field in Opportunity in CRM On Demand where we can give the user an option to select one of the records. Data in this search applet should come from another Record Type in CRM On Demand. I am not able to find any similar literature in the Help books.
    I would appreciate if somebody could give me real life steps please.
    Thanks a lot

    Okay. I found the solution to this.
    Now, along with this single reference, we also wish to bring the values of some more joined fields from the other record type in the Opportunities screen.
    We were hoping that the Default value, and using fx, we should be able to achieve this using "joinedfieldvalue". However, it's not bringing back any value. Our expression is -
    JoinFieldValue('<CustomObject3>',[<CustomObject3Id>],'<stState_ITAG>')
    Please help if you have done this before.
    Thanks & Regards

  • Selecting single record from multiple record based on date

    Hi experts,
    I have a table which contains the multiple records for single ID No. Now i have to select single record which contains the latest date.
    here is the structure
    Name   Null Type        
    ID_P        NUMBER      
    NAME_P      VARCHAR2(12)
    DATE_P      TIMESTAMP(6)
    Records
    1 loosi     22-AUG-13 01.27.48.000000000 PM
    1 nammi  26-AUG-13 01.28.10.000000000 PM
    2 kk        22-AUG-13 01.28.26.000000000 PM
    2 thej      26-AUG-13 01.28.42.000000000 PM
    now i have to select below 2 rows how can write select qurie for this?
    1 loosi     26-AUG-13 01.27.48.000000000 PM
    2 thej      26-AUG-13 01.28.42.000000000 PM

    Hi,
    You can use the analytic ROW_NUMBER function.
    I don't have a copy of your table, so I'll use scott.emp to illustrate.  In scott.emp, there may be multiple rows for a single job.  To display just 1 row per job, the row with the most recent hiredate:
    WITH got_r_num AS
         SELECT  empno, job, deptno, hiredate -- Or whatever columns you want
         ,       ROW_NUMBER () OVER ( PARTITION BY  job
                                      ORDER BY      hiredate DESC
                                    )  AS r_num
        FROM    scott.emp
    --  WHERE ...   -- If you need any filtering put it here
    SELECT   *      -- Or list all columns except r_num
    FROM     got_r_num
    WHERE    r_num   = 1
    What results do you want in case of ties?  Depending on your requirements, you may want to add tie-breaking expressions to the analytic ORDER BY clause, and/or use RANK instead of ROW_NUMBER.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    Point out where the query above is producing the wrong results, and explain, using specific examples, how you get the right results from the given data in those places.
    If you modify the query at all, post your modified version.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Help with selecting 10 random records from all records meeting report selection criteria in Crystal 11

    <p>I am trying to select ten random records from all that match the report selection criteria then report on each of these random records for QA/QI.  I have tried the RND function however it is giving me a random number rather than a random record selection.  I cannot figure this out and am despirately seeking assistance.</p><p>Thank you,</p><p>Amy</p>

    <p>I don&#39;t know of any Random record selection functions but maybe you could write your own custom function inside of a record selection to randomly filter the records.  You would use the Rand function we currently have to decide if a record was included in the report data or not.</p><p>Another possible option is to filter the records before they get to the report.  You can only do this if you are pushing the data into the report instead of having the report pull the data.  An example of this would be passing an ado recordset to a report at runtime. </p><p>Rob Horne</p><p>http://diamond.businessobjects.com/blog/10 </p>

  • Creating multiple records from 1 record in the source file for Import DM

    Hi Experts,
    Today I am working on an interface/import where I want to get the following result:
    Source file contains a records like:
    Account, Entity, DriverX
    Sales,EntityA,ZZ
    The BPC appset contains the 2 dimensions Account and Entity next to CostCenter dimension. The DriverX field in the source file is just additional information in the source file. However based on this DriverX we need to determine what CostCenter to choose but we also need to have the same record assigned to a second record in BPC.
    Following my example, based on DriverX value I need to create 2 records:
    Account, Entity, CostCenter,
    Sales,EntityA,CC1
    Sales,EntityA,CC2
    I don't have a problem assigning the record to 1 CostCenter based on DriverX value but I have a problem creating my second record. Does any of you have had the same "challenge" and if so would you like to share the solution for this?
    Best regards,
    Johan
    PS: I am working on SAP BPC, version 7.0 Microsoft version.

    Hi Greg,
    Many thanks for your answer. And yes this would be a solution. However I just simplified my case as the decision to create an second record and where to post is depending on more than 1 field in the source.
    But I will keep it in mind, because I also can opt for a solution to store data differently in BPC fac-tabels which will help me to use script logic.
    If it is not possible to create multiple records from a single records in the standard functionality in the Transformation and/or Conversion file, I have to create a custom DTSX or change my way of storing data.
    Anyone else who is having an alternative idea like Greg came up with?
    Please let it know!
    Best regards,
    Johan

  • Help in selecting required columns from duplicates records

    HI,
    I have a table like below
    empid,ename,sal,Jdate,Rdate,deptid,designation,Terminated_Emp
    1,a,100,15-May-2014,11,SE,NO
    1,null,null,15-OCT-14,null,null,YES
    I want output like below
    1,a,100,15-May-2014,15-OCT-2014,11,SE,YES
    Please help me in writing sql query, can we write case condition for this?
    Naresh

    HI
    And I have to select remaing records from first row only
    I mean
    empid,ename,sal,Jdate,Rdate,deptid,designation,Terminated_Emp
    1,a,100,15-May-2014,null,11,SE,NO
    1,null,null,null,15-OCT-14,null,null,YES
    2,b,200,12-Jan-2014,null,12,SSE,NO
    I want records like
    1,a,100,15-May-2014,15-OCT-2014,11,SE,YES
    2,b,200,12-Jan-2014,null,12,SSE,NO
    Naresh

  • RoadMap does not return the selected step on ESS 600 Record Time entry

    RoadMap does not return the selected step on Record Time entry application in ESS. Is it suppose to behave similar way or is it suppose to take user to the selected step. If yes , then is there a setting or customization that i have to take care of, as its a standard SAP delivered ESS Record working time application.
    Please let me know. I appreciate your help in advance.

    Check with administrator in the src configuration thing,
    Cheers,
    Apparao

  • How to obtain parent record from child record in relationship using API

    Hi,
    I have a record in the main table that is the child in a parent/child relationship to another main table record.  Using the Java API, how would I obtain the parent record in the relationship where I am starting with the child record?  In the API there seems to just be calls for getChildren, but not a getParent type call.
    Appreciate any immediate help that can be provided.
    Thanks,
    Eddie

    Hi Eddie,
    Please follow the below steps to retrieve only parents of a child Record.
    1. Create RetrieveRelationshipsCommand.
    2. Set the parameter RelationshipId.
    3. Set the parameter Anchor Record and Anchor Record Id. In this case the child record for which parents records to be retrieved.
    4. Set the parameter setGetChildren as false . This retrieves only the parent records for the specified child reocrd.
    5. Execute the RetrieveRelationshipsCommand.
    6. Retrieve member records from above step.
    Hope it helps
    Regards,
    Neeharika

  • Creating addititional records from one record and spreading total accross

    Can anyone help me with the following script logic scenario...
    We have an account with $$ and wish to spread it accross the remaing months of another scenario. 
    For example, In 2012.Jan, we have an Actual amount = 10,000.  Also, 2012.Jan Forecast = 5,000. 
    I need to take the difference -5,000 and push it into Forecast 2012.Feb, 2012.Mar, ... 2012.Dec and spread it evenly (-454.55).

    Hi Danny,
    Welcome to the forums!
    Here is a sample script to get you going:
    //Scope in the ACTUAL and FORECAST categories
    *XDIM_MEMBERSET CATEGORY=ACTUAL,FORECAST
    //Only scan through the actual data and only use the forecast data in the GET command within the *REC statement down below
    *XDIM_NOSCAN CATEGORY=FORECAST
    //Scope in the time period 2012.DEC
    //You should eventually make this dynamic using a *SELECT statement
    *XDIM_MEMBERSET TIME=2012.JAN
    *WHEN *
    *IS *
    //This for loop should become dynamic using a *SELECT statement. Choosing the months to forecast
    *FOR %MYTIME% = 2012.FEB,2012.MAR,2012.APR,2012.MAY,2012.JUN,2012.JUL,2012.AUG,2012.SEP,2012.OCT,2012.NOV,2012.DEC
    //Note you will need to add a property to your CATEGORY dimension called FCST_NUM and put a value of 11 for the ACTUAL member. This value will need to be updated as the number of months to forecast changes.
    *REC(EXPRESSION=((%VALUE%-GET(CATEGORY="FORECAST"))/FLD(CATEGORY.FCST_NUM),CATEGORY=FORECAST, TIME=%MYTIME%)
    *NEXT
    *ENDWHEN
    *COMMIT
    Two caveats is that data must always reside in the ACTUAL category. Since the logic is looping through every record in the ACTUAL category. Also, all the other data must be at the same intersection or else the GET statement will be looking in the wrong place. i.e. DataSrc for the Actuals and Forecast has to be at the INPUT member or else you would need specify where the data is for forecast category in the GET statement.
    Let me know how this goes.
    Thanks,
    John

  • Get range in one record from individual records

    Hi,
    I want to get range (eg: No. 1-5) in record from 5 separate records.
    Eg:
    Data
    ID Group#
    123 1
    123 2
    123 3
    123 4
    123 5
    123 9
    Expected result
    ID Group
    123 1-5
    123 9
    Thanks
    AT

    Hi,
    That is:
    WITH     lagged     AS
         SELECT     id, group#
         ,     LAG (group#, 1, group#) OVER
                   ( PARTITION BY     id
                     ORDER BY     group#
                   )     AS prev_group#
         FROM     table_x
    ,     regimed     AS
         SELECT     id, group#
         ,     COUNT     ( CASE
                        WHEN  group#     > prev_group# + 1
                        THEN  1
                     END
                   ) OVER     ( PARTITION BY     id
                          ORDER BY     group#
                        )     AS regime_num
         FROM     lagged
    SELECT     id
    ,     TO_CHAR (MIN (group#))
         || CASE
              WHEN  MAX (group#) > MIN (group#)
              THEN  '-' || TO_CHAR (MAX (group#))
            END     AS group#_range
    FROM     regimed
    GROUP BY     id, regime_num
    ORDER BY     id, regime_num;I assume your real data has multiple values for id, which need to be kept separate.
    This sample data:
    INSERT INTO table_x (id, group#) VALUES (123,     1);
    INSERT INTO table_x (id, group#) VALUES (123,     2);
    INSERT INTO table_x (id, group#) VALUES (123,     3);
    INSERT INTO table_x (id, group#) VALUES (123,     4);
    INSERT INTO table_x (id, group#) VALUES (123,     5);
    INSERT INTO table_x (id, group#) VALUES (123,     9);
    INSERT INTO table_x (id, group#) VALUES (987,     1);
    INSERT INTO table_x (id, group#) VALUES (987,     1);
    INSERT INTO table_x (id, group#) VALUES (987,     2.5);
    INSERT INTO table_x (id, group#) VALUES (987,     3.4);
    INSERT INTO table_x (id, group#) VALUES (987,     4.3);produces these results:
    .       ID GROUP#_RANGE
           123 1-5
           123 9
           987 1
           987 2.5-4.3

  • How to Create WebService (the Server, not Client) from existing WSDL

    Does anyone have any suggestions on how to create a WebService from existing WSDL.  I have been asked to implement a WebService (the Server) based on WSDL from a standards based consortium.  I have created several WebServices in the past and the generated WSDL under my control.  Does Axis WebServices generate WebService service stub Java code?

    Hai
      you can create stubs for AXis webservices also
      for help use the following link
    http://www.onjava.com/pub/a/onjava/2002/06/05/axis.html?page1

  • Edit the select option in an existing Transfer Structure

    Hello everybody,
    I've a problem with my NW2004s BI-construct which contains reporting for the SAP IS-U sales statistics. I used the SAP BC Data Source, Info Source and Cube. Now I started the data transfer process. The BI 7.0 could connect to the IS-U but it failed with the comment no data selected. I recognized that the selection option in the transfer structure for the object 0PSTG_DATE isn't set which I mean must be set. Has anyone of you a solution for setting the selection flag in the existing transfer structure!
    Thanks a lot in advance!
    Best regards,
    Thomas

    Thx for your advise, Marc.
    I checked it already. The thing is that the object is marked as a selection object in SAP ECCs Data Source. I also replicated the Data Source again into BI but unfortunately that changed nothing.
    Any other suggestions?
    Would be gorgeous!
    Thanks & Bye, Tom

Maybe you are looking for

  • Poor perfomance CORBA and EJB in Oracle 8i

    Here are the perfomance results of methods invocations (1000 invocations of empty method in an loop) Oracle 8i CORBA ~100ms per method Oracle 8i EJB ~100ms per method Jonas EJB server ~5ms per method Java RMI ~3ms per method Why Oracle 8i is so slow,

  • When I transferred my itunes library, several song titles have odd characters in them

    I transferred my library from PC to Mac - some song titles that look OK on PC have odd characters in their title on Mac - why?  These songs still play fine and I can find no other problem with them.

  • Drop partition with missing associate Tablespace

    Hi All, Scenario is user accidentally removed datafile using rm command then we dropped that Tablespace using offline drop. we want to drop partition for which TS and datafile both are already offline dropped . Thanks.

  • I can't import Quicktime movies into FCE 4?

    Hi, I'm trying to import an eight second Quicktime movie (that I made in the new Motion 5) into Final Cut Express 4. When I try to import it, a message pops up saying "Error: Unknown File." Is there anything I'm doing wrong? Thanks in advance!

  • Get error when trying to create iCloud e-mail alias

    When I try to create an email alias on iCloud I get the error: "Address couldn't be saved because a server error occurred. Please try again." I've tried repeatedly. No luck.