as with the select query

Hello

I have a query something like...

Select...

....

where

b.ProdName as 'GEAR of the TREE %' or b.prodname like '% FRONT GEAR %' or b.prodname like '% BREAK 4 %k '.

and

b.ProdName as

(select the name of the society of companyms

where < some comdition >

)

order of 3.6

I have blocked in:

b.ProdName as

(select the name of the society of companyms

where < some comdition >

)

How to give a select query with like operator.

In above query I want to b.prodname as above and the name of the company for which I give condition.  Company names are stored in another table and I want to select and use them with like operator.

Thank you.

Hello

It is not clear what you want to do.

One possibility is an EXISTS subquery, like this:

...

WHERE (b.prodname LIKE "% of the CYCLE of the TREE" - begins with this text

OR b.prodname LIKE '% FRONT GEAR %' - contains this text

OR b.prodname LIKE '% BREAK 4 %k' - contains this text

)

AND THERE ARE)

SELECT 1

OF companynms

WHERE--a condition

AND b.prodname AS business

)

I hope that answers your question.
If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the results desired from these data.
Explain, using specific examples, how you get these results from these data.
Always say what version of Oracle you are using (for example, 11.2.0.2.0).

See the FAQ forum: https://forums.oracle.com/message/9362002

Tags: Database

Similar Questions

  • Disable the text with the selection query list element?

    4.2.1

    THM:2

    Hi all

    In the full text with Auto item, is the query preloaded when the page loads? Or is it run only when the user enters any text? Reason being that on the follow-up to our application apex because of a performance issue, it was noted that the query associated with the AutoComplete text box was running 3 times, (it has been referred to in 3 places on the same page in a sql report. We feel that the sql would be only when someone starts to enter a value in the field? If this isn't the case, we can disable to run when the page loads?

    In addition, if the text with Auto C is used in the where clause of a sql report, would it be internally run the underlying sql query? Should he treats not only as a text element?

    Thank you

    Ryan

    Hi Ryan,

    Please see the concept of lazy loading of AutoComplete.

    http://blog.whitehorses.nl/2010/02/25/Oracle-Apex-4-0-text-field-with-AutoComplete/

    -Sunil Bhatia

  • How to store results of the select query in the tables.

    I created a variable varray type and now want to assign some data of output of the select query in pl/SQL, as well as in reports 6i.

    You are in the wrong forum (this is for problems with the SQL Developer tool). You were the one where you have published first on the right, but not to reuse independent threads as you did.

    Kind regards
    K.

  • Count (*) with the nested query

    Hello
    I have a question about the count (*) with the nested query.

    I have a table T1 with these columns:
    Number of C1
    Number of C2
    Number of C3
    Number of C4
    Number of C5

    (The type of each column is not relevant for example).

    This query:
    Select C1, C2, C3, C4
    from T1
    Group C1, C2

    It is not correct becausa C3 and C4 are the columns specified in the GROUP BY expression.

    If you run this query:
    Select count (*)
    (select C1, C2, C3, C4
    from T1
    Group C1, C2)

    I don't have an error message (properly, the result is the number of records).

    Why?

    Thank you.

    Best regards
    Luca

    because the optimizer rewrites as

    SELECT     COUNT(*)
                  FROM   T1
              GROUP BY   C1, C2  
    

    G.

    Edited by: g. March 1, 2011 09:19

  • The select query-based search page...

    I want to create a basic search page at the base on a select query.

    The select query will not be based on Table.Its based on functions.

    I created a view like this object

    Select xx_test_accruals(:p_date) of ACCUMULATION: p_date double DT

    I created a search page

    In the area of provision of Home Page, I added a region of the query. In this region of request I created a result based research Table.

    When I run the page opens with the field

    DT

    When I get back the date and click go, I get the error message like this...

    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: 27122 Houston: SQL error in the preparation of the statement. Statement: SELECT * FROM (select xx_test_accruals(:p_date) of ACCUMULATION: p_date double DT) QRSLT WHERE ((UPPER (DT) like: 1 AND (DT as: 2 OR DT as: 3 OR DT as: 4 OR DT as: 5)))



    Help, please

    Published by: [email protected] on October 4, 2009 14:04

    Hello

    I tried it on my machine... There is a little change on the approach.

    See we have a display object: XxAccrualsSummaryVO

    the query is

    Select xx_test_accruals (to_date (: 1, 'YYYY-MM-DD')) DT ACCRUAL, double to_date(:2,'YYYY-MM-DD')

    Create a view property object: say DateTestPVO and create a transitional DATE type attribute say dated. MinValue. How to create the View Object(read in dev guide) property.

    Link the date to DateTestPVO text entry and the date attribute. MinValue.

    Now that the page will load in process request initialize the PVO not XxAccrualsSummaryVO.

    Public Sub initialisePVO()
    {

    OAViewObject vo = (OAViewObject) getDatePVO1 ();
    If (! vo.isPreparedForExecution ())
    {
    vo.setMaxFetchSize (0);
    }
    Line = vo.createRow ();
    vo.insertRow (row);
    row.setNewRowState (Row.STATUS_INITIALIZED);

    }

    And when you press the Go button and then enter the date entered and set the location where the XxAccrualsSummaryVO clause.

    If (PageContext.GetParameter ("Go")! = null)
    {
    Get the value entered by the user in the date field.

    DateField OAMessageDateFieldBean = (OAMessageDateFieldBean) webBean.findIndexedChildRecursive ("text");
    String datetest = (String) dateField.getValue (pageContext) m:System.NET.SocketAddress.ToString ();
    Now set the where clause VO settings.
    OAViewObject vodate = (OAViewObject) am.findViewObject ("invoicetestVO1");
    vodate.setWhereClauseParams (null);
    vodate.setWhereClauseParam(0,datetest);
    vodate.setWhereClauseParam(1,datetest);
    vodate.executeQuery ();
    }

    It works perfectly... I tested it.

    Thank you
    Gerard

  • How to optimize the select query executed in a cursor for loop?

    Hi friends,

    I run the code below and clocked at the same time for each line of code using DBMS_PROFILER.
    CREATE OR REPLACE PROCEDURE TEST
    AS
       p_file_id              NUMBER                                   := 151;
       v_shipper_ind          ah_item.shipper_ind%TYPE;
       v_sales_reserve_ind    ah_item.special_sales_reserve_ind%TYPE;
       v_location_indicator   ah_item.exe_location_ind%TYPE;
    
       CURSOR activity_c
       IS
          SELECT *
            FROM ah_activity_internal
           WHERE status_id = 30
             AND file_id = p_file_id;
    BEGIN
       DBMS_PROFILER.start_profiler ('TEST');
    
       FOR rec IN activity_c
       LOOP
          SELECT DISTINCT shipper_ind, special_sales_reserve_ind, exe_location_ind
                     INTO v_shipper_ind, v_sales_reserve_ind, v_location_indicator
                     FROM ah_item --464000 rows in this table
                    WHERE item_id_edw IN (
                             SELECT item_id_edw
                               FROM ah_item_xref --700000 rows in this table
                              WHERE item_code_cust = rec.item_code_cust
                                AND facility_num IN (
                                       SELECT facility_code
                                         FROM ah_chain_div_facility --17 rows in this table
                                        WHERE chain_id = ah_internal_data_pkg.get_chain_id (p_file_id)
                                          AND div_id = (SELECT div_id
                                                          FROM ah_div --8 rows in this table 
                                                         WHERE division = rec.division)));
       END LOOP;
    
       DBMS_PROFILER.stop_profiler;
    EXCEPTION
       WHEN NO_DATA_FOUND
       THEN
          NULL;
       WHEN TOO_MANY_ROWS
       THEN
          NULL;
    END TEST;
    The SELECT inside the LOOP FOR cursor query took 773 seconds.
    I tried to use COLLECT in BULK instead of a cursor for loop, but it did not help.
    When I took the select query separately and executed with a value of the sample, and then he gave the results in a Flash of a second.

    All tables have primary key index.
    Any ideas what can be done to make this code more efficient?

    Thank you
    Raj.
    DECLARE
      v_chain_id ah_chain_div_facility.chain_id%TYPE := ah_internal_data_pkg.get_chain_id (p_file_id);
    
      CURSOR cur_loop IS
      SELECT * -- better off explicitly specifying columns
      FROM ah_activity_internal aai,
      (SELECT DISTINCT aix.item_code_cust, ad.division, ai.shipper_ind, ai.special_sales_reserve_ind, ai.exe_location_ind
         INTO v_shipper_ind, v_sales_reserve_ind, v_location_indicator
         FROM ah_item ai, ah_item_xref aix, ah_chain_div_facility acdf, ah_div ad
        WHERE ai.item_id_edw = aix.item_id_edw
          AND aix.facility_num = acdf.facility_code
          AND acdf.chain_id = v_chain_id
          AND acdf.div_id = ad.div_id) d
      WHERE aai.status_id = 30
        AND aai.file_id = p_file_id
        AND d.item_code_cust = aai.item_code_cust
        AND d.division = aai.division;         
    
    BEGIN
      FOR rec IN cur_loop LOOP
        ... DO your stuff ...
      END LOOP;
    END;  
    

    Published by: Dave hemming on December 4, 2008 09:17

  • passing parameters to the select query in DB link to call him...

    I have a DB link that executes the select query based on user specified parameter.

    Now, I created an invoke activity and specified input [which must be passed to the query] and output parameters [it is the result of the query]. That invoke link activity DB calls in which a parameter was created to be used in the select query. So my question is, DB link partner take the input parameter of call activity automatically or do we need to specify a mapping for this?

    When you create a partnerlink db the setting that you create for your chosen matches the entry and when you create the variable entry in the invoke for this partnerlink is created with the type of the parameter.

    Create an assignment before your invoke and assign a value to the input variable that you created in the invoke. This value will be passed and used as a parameter in the selection.

    Heidi.

  • Not compatible with the selected drive - Satellite A300D firmware update

    Hi, I have a problem with the update of the firmware. When I try it says "the Firmware is not compatible with the selected driver.

    And another problem is that my dvd drive does not DVD - R and DvD + R is running very slow and big trouble, it must try several times to succeed.

    Please help me.

    Hello

    Maybe you should tell us what CD/DVD drive you have and where you have downloaded the update of the firmware.
    In my opinion firmware update is not normally necessary.

    Have you ever tried to remove upper and lower filters in the registry? This often solves problems with ODD.

  • How to use the selection tool to resize a text box? Before I was able to click on the text box with the selection too in order to resize, but now I click on it and it only gives me 'path' or 'anchor' options.

    How to use the selection tool to resize a text box? Before I was able to click on the text box with the selection too in order to resize, but now I click on it and it only gives me 'path' or 'anchor' options.

    Ashley,

    What about window > show the rectangle enclosing (Ctrl / Cmd + Shift + B to toggle)?

  • Objects can be moved with the selection tool - InDesign CC2015

    Hello

    Can someone help with this problem? I can't move an object with the selection tool. I am able to select and change the coordinates to move objects, but thnot with the selection tool.

    I've updated the software and replaced the preferences.

    Thank you

    -Michael

    Thanks for the reply. I tried so many things that I could think of. For some reason, I didn't to restart my computer. That's what fixed it. Thanks again for your response.

  • Title change with the selection of mode selector

    Hello Experts,
    I have a report that is divided into three different reports and I use a selector to display for the three reports, the title needs to change with the selection of the report, and I gave the name of view as selector select the report. I was wondering if there is a way to do it. I tired adding @{select report} in the title, but it does not work. Please notify.

    Thank you
    RC

    user1146711 wrote:
    I have this setup already in place and I want the title to change with the selection in the view.

    Why it is not working? The view selector simply selects the name of the reports. When selected, the composed page should show the title of the actual report, which will be different for each view because they are exemplary.

    I'm not at work so I can't test this, but if you have successfully copied the title of the view and any copies, when you change a all the changes; then maybe the works of title as the Table view. If this is true, use the display of the title, but rather to use the view of the narrative and follow my steps above. See if it works.

    Edited by: David_T December 29, 2011 07:41

  • Create and schedule the iBot cover seed with the saved query

    Hi all

    Can I know how to create and schedule I Bot seeds cached with the saved query ((iBot to directly run a daily load of reseeding the cache)

    Here's the documentation:

    30%

    http://download.Oracle.com/docs/CD/E10415_01/doc/bi.1013/b31767.PDF

    31%

    http://download.Oracle.com/docs/CD/E21764_01/bi.1111/e10544/delivers.htm#i1060405

  • Cursor does not change with the selection tool

    If anyone has experienced this?  My cursor suddenly does not change with the selection tools when working on the photos.  Once I roll over the image, the arrow disappears and becomes a strange 3 little things, so cannot do any work with precision.  Still using 7 PS in Windows 7.  It wasn't a problem before.  Already uninstalled and reinstalled and the problem is still there.  I searched where this can be corrected.  So far, no luck.  Any suggestions?

    Three cursors display in Photoshop, Bridge, and Camera Raw (Windows 7)

  • CS5, blocks of text with the selection tool.

    InDesign CS5:

    I work on several documents that requires to move blocks of text.

    When I select the text block with the selection tool, my cursor will move immediately to the text tool.

    I'm not double click, only clicking once to select.

    I don't want to edit text, select only the text block, so I can move it.

    Is there a way to disable this feature?

    Or maybe a tip and Trick so the tool rest the tool selection and not switch to the type tool.

    Thank you in advance.

    Kathryn

    As stupid as it may sound, try a different mouse.

    We prefer to keep the choice to convert an empty block to a block of text, but here already are blocks of text.

    Bob

  • Problems with the selections in cs5

    Hey, recently I started noticing odd behavior that's not happened before involving selections in photoshop cs5.

    the first thing I noticed, when I made a selection with the lasso on any given layer and hit transform, the tool only has not automatically select active pixels as it did before. Instead, the processing area was around the entire selection, I did even if the borders do not contain active pixels. It is a very big problem for me because when I have my items in a certain place, and I want to turn them in this position, thay move somewhat because the selection is not limited to the shape. I was wondering if this is some new CS5 that can be changed. or old function that I've accidentally switched on.

    My second problem is that when I make a selection with the Selection tool or the lasso tool, then I swiitch on the move tool to move the selected content and then switch back to a selection tool to delete only a part of the previous Thatcher so that I can spend the rest of the content, place of deselection of this region, it erases the pixels contained in the deselection. and I just want to remove the selection, do not delete the pixels. I also wonder if it is a function that can be modified or if I have a big problem.

    Any help will be much appreciated.

    AD 1)

    A solution might be to switch to the tool move and press the left and right arrow in the order.

    AD 2)

    One solution might be to enter and exit quick mask by Q hit twice.

Maybe you are looking for

  • He cannot find the buttons to put on my Page of Firefox.

    A few months ago, I installed Firefox. There were all these little buttons (or whatever they were...) that I could choose to add to my Menu bar - about 50, 60, 80 or more choice. I chose about 5 of them and then put them immediately sloppy on my Menu

  • Satellite T130 - 10G: extra port for mini SSD?

    Hi there :) I found an empty port in my T130, near the port of hard drive, see also here-> [klick | http://www11.pic-upload.de/08.07.14/3aosd93avlc5.jpg] It's a job mSATA-Port for mini-SSD as "ADATA SX300 mSATA SSD 128 GB"so I can use both, _and_ SSD

  • DVD - ROM works do not (S1800-804)

    Suddenly, the DVD doesn't work. The light is on permanently. The dvd seems to begin by putting in a disk, but doesn´t actually read any CD or DVD. Nothing happens. Everyone who recognize this behavior, or what to do?BIOS (2.20)

  • Cable IEEE 1394 to 800 FireWire MBP mid 2012

    Hello Currently, I discovered an old camcorder (Samsung VP-D371) that uses a DV IEEE 1394 cable entry. I have an old cable, but does not support the USB or firewire 800 appropriate. My question is: the Macbook Pro for mid-2012 capture the videos save

  • Problem with LabPython - unable to operate...

    Ladies and gentlemen, I have a little problem with LabPython... I have download LabPython here: http://labpython.sourceforge.net/ (last version 1.2 of 15 Jan 08) Then Python from here: http://www.python.org/ (latest version 2.6 from 01 Oct 08) Now tr