How to select rows as some passes?
Hi all
11.2.0.1
I have two tables
Emp1 (name1) contain values:
=================
Justin bieber peralta
Bruno March minoza
EMP2 (name2) contain values:
=============
Bieber
March
I want to choose emp1 name1 where name1 like ' % | name2. %' of emp2.
I'm confused about the syntax
Thank you
pK
Select e1.*
from emp1 e1
emp2 e2
where e1.name1 like '% "| E2.name2 | '%'
Ery Plan
Operation | Options | Object | Rows | Time | Cost | Bytes |
Filter Predicates * | access Predicates |
---|---|---|---|---|---|---|---|---|
SELECT STATEMENT
|
31 015 | 1 | 796 | 527 255 | ||||
NESTED LOOPS |
31 015 | 1 | 796 | 527 255 | ||||
ACCESS TABLE |
STORAGE FULL | EMP2 | 8 | 1 | 4 | 40 | ||
ACCESS TABLE |
STORAGE FULL | EMP1 | 3 877 | 1 | 99 | 46 524 | 'E1 '. "' NAME1 ' LIKE '%" | ' ' E2 '. "' NAME2 ' | " %' | 'E1 '. "' NAME1 ' LIKE '%" | ' ' E2 '. "' NAME2 ' | " %' |
Columns not indexed are marked in red
Columns in index
Columns in the table
Table Owner | Table Name | Column Name | Data Type |
---|---|---|---|
ETBIN | EMP1 | NAME1 | VARCHAR2 |
EMP2 | NAME2 | VARCHAR2 |
Select *.
from emp1
where exists (select 1 from emp2 where emp1.name1 like '%' | name2 |) '%')
Query plan
Operation | Options | Object | Rows | Time | Cost | Bytes |
Filter Predicates * |
Access Predicates |
---|---|---|---|---|---|---|---|---|
SELECT STATEMENT
|
32 | 13 | 9 850 | 384 | ||||
FILTER |
THERE ARE (SELECT "EMP2" 0 'EMP2' WHERE: B1 LIKE '%' |) "' NAME2 ' | " %') | |||||||
ACCESS TABLE |
ACCESS TABLE
Columns not indexed are marked in red
bars
Columns in the table
Table Owner | Table Name | Column Name | Data Type |
---|---|---|---|
ETBIN | EMP1 | NAME1 | VARCHAR2 |
EMP2 | NAME2 | VARCHAR2 |
Select *.
from emp1
where to trim (substr (name1,
InStr (name1,' ', 1, 1) + 1.
InStr (name1,' ', 1, 1)-instr (name1,' ', 1, 1)
)
) in select (separate name2
from emp2
)
Query plan
Query plan
Operation | Options | Object | Rows | Time | Cost | Bytes |
Filter Predicates * |
Access Predicates |
---|---|---|---|---|---|---|---|---|
SELECT STATEMENT |
HASH JOIN
VIEW
HASH
ACCESS TABLE
ACCESS TABLE
Columns not indexed are marked in red
Ndex columns
Columns in the table
Table Owner | Table Name | Column Name | Data Type |
---|---|---|---|
ETBIN | EMP1 | NAME1 | VARCHAR2 |
EMP2 | NAME2 | VARCHAR2 |
According to very different plans, it must be a difference any.
(ascheffer posted before cardinalities were known)
Concerning
Etbin
Tags: Database
Similar Questions
-
How effectively select rows randomly a large table?
Hello
The following code selects 5 lines of a random set of rows in the table emp (employee)
My concern is that the internal selection causes a table scan in order to assign a random value to each line. This code when it is used against a large table can be a performance issue.select * from ( select ename, job from emp order by dbms_random.value() ) where rownum <= 5
Is there an effective way to random selection rows in a table without having to do a table scan? (I'm new to Oracle, so it is possible that miss me a very simple way to perform this task.)
Thank you for your help,
John.
Published by: 440bx on July 10, 2010 18:18Take a look at the clause of the select statement. The number in brackets is a percentage of the table.
SQL> create table t as select * from dba_objects; Table created. SQL> explain plan for select * from t sample (1); Explained. SQL> @xp PLAN_TABLE_OUTPUT ------------------------------------------------------------------------------- Plan hash value: 2767392432 ---------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ---------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 725 | 70325 | 289 (1)| 00:00:04 | | 1 | TABLE ACCESS SAMPLE| T | 725 | 70325 | 289 (1)| 00:00:04 | ---------------------------------------------------------------------------- 8 rows selected.
-
How to select rows whose column contains specific characters?
It is a telling of the T1 table with say column C1
Either the C1 field values:
1st row) OF/SPT/A/FWD
line 2) G/SPT/DE/OF/SPT
rank 3) R/FWD/SPT/A/FWD/FWD
rank 4) A/A/OF/SPT/FWD
rank 5) FWD/SPT/E/OF/A
How to get only the lines whose C1 column contains FWD last?We can solve this problem with the simple use of a wildcard character:
select * from t1 where c1 like '%FWD' /
Note that this query runs a full table scan, because any index you can have on C1 will be ignored: the indexes are organized on the main characters.
Cheers, APC
-
How to select rows randomly by the percentage of lines by specific column
I need to select exactly 20% of lines by Department randomly. Ex, table composed of 50 records for the Sales Department, 60 discs for the Department of human resources. I need to get 10 records of the Department sales and 12 records of Department of human resources. but records should be chosen at random. How to get out of it? Thanks in advance.
Select
DEPTNO
count (*) NTC
WCP
Deptno group
DEPTNO CNT
30 6
20 5
3 of 10
Choose 50% in every department at random
expected (round up to the next integer)
DEPTNO CNT
30 3
20 3
2 of 10
Select * from)
Select
EmpNo
deptno
, count (*) during the (partition deptno) cnt
row_number() over (partition by deptno arrested by dbms_random.random) rn
WCP
)
where rn<=>=>
order by deptno
EMPNO DEPTNO CNT RN
7782 10 3 1
7934 10 3 2
7566 20 5 1
7876 20 5 2
7902 20 5 3
7900 30 6 1
7521 30 6 2
7654 30 6 3
-
Hi all
We use JDeveloper Studio Edition Version 12.1.3.0.0 and deployed on GlassFish Server Open Source Edition 3.1.2.2 (build 5) and connect to the SQLServer database.
How to get the selected line in a programmatic (using a SortableModel custom not a display object) ADF table (generated from a bean)?
We are trying to get the selected row in a bean of a programmatic ADF table to retrieve data based on the selected line.
Any idea?
Well, you can use selectionListener to set the selected line to a variable of bean (but this bean must be in extended view or some superiors)
Something like this: http://www.awasthiashish.com/2015/07/get-selected-row-singlemultiple-from.html
Dario
-
ADF Table how to change the color Selected row in the array unfocuse.
Hi all
I have a requirment where I select the row of the table ADF and unfocuse on the table.
According to the framework it gives me the light yellow color.
How can I change this color with another color.
Pls suggest.
Thanks to Advans
Barry Mucheli.
Hello, Barry Mucheli.
To change the color of the selected row when it loses focus, add the following code in your skin css file.
AF | : the table-row data: selected: inactive af | : the column cell data
{
background-color: Green;
}
RFH.
-
After I converted the PDF to Word how to select some pages to save as a new document? Thank you
You said you have a Word file and use certain pages in the file to create a new document.
Use Word to create a new Word file that has the pages you want for the original Word file.
You now have a "new document" desired pages.
With Acrobat Standard or Pro installed, you can create a 'new document' PDF.
If you don't have Acrobat Standard or Pro, or a subscription to an Adobe online service that can create PDFS from MS Word, you can use the Microsoft process to create PDF that comes with MS Word.
Be well...
-
How to select a row in a table of adf after double click
I have a table that displays a list of records when the user double-clicks a particular line, I want to select row. The largest part of the example has a separate button for the user to click on choose and I don't want that.Hello
On your table have a clientListener and a serverListener:
....Your clientListener should send a request to the server using AdfCustomEvent.queue:
function dblClickClientLstnr (event) {}
element var = event.getSource (event);
AdfCustomEvent.queue (element, "dblClickServerLstnr", (), true);}
..............On your support of bean, you can retrieve the selected line, for example:
{} public void getSelectRow (ClientEvent clientEvent)
DCBindingContainer dcBindings = (DCBindingContainer) ADFUtils.getBindingContainer ();
DCIteratorBinding iterBind = (DCIteratorBinding) dcBindings.get ("myViewIter");
Line = iterBind.getCurrentRow ();}
I hope this helps.
-
How do I get the selected row in the table (FacesCtrlHierBinding).
I am trying to get the data of the selected row in the table:
RowBinding () (FacesCtrlHierBinding) tab.getSelectedRow = FacesCtrlHierBinding;
Line rw = rowBinding.getRow ();
But for oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding be found since my 11 JDev to import.
What is a good package for FacesCtrlHierBinding?Hello
This is the code I use to get the selected rows in a rich table of adf:public void deleteMarkedRows() { RichTable table = this.getImportTable(); //get table bound to UI Table RowKeySet rowKeys = table.getSelectedRowKeys(); Iterator selection = table.getSelectedRowKeys().iterator(); while (selection.hasNext()) { Object key = selection.next(); table.setRowKey(key); Object o = table.getRowData(); JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding) o; Row row = rowData.getRow(); row.remove(); } //prepare table to show changes table.setFirst(0); RequestContext.getCurrentInstance().addPartialTarget(table); }
Hope this helps
Timo
-
Hallo,
I have an af:table that displays the result of a custom search form.
I need to update the properties of some of the buttons every time that a row in the table is selected.
I would like to handle this in a SelectionListener I associated with the table.
public void myTableSelectionListener(SelectionEvent selectionEvent) { ELUtils.invokeEL("#{bindings.SearchEmployee1.collectionModel.makeCurrent}", new Class[] { SelectionEvent.class }, new Object[] { selectionEvent }); Row selectedRow = (Row) ELUtils.evaluateEL("#{bindings.SearchEmployees1Iterator.currentRow}"); System.out.println(selectedRow.getAttribute("Name") + " - " + selectedRow.getAttribute("Surname")); }
I noticed the System.out.println prints the values of the selected line only when the user clicks on a line while that no value does print when the grid is recharged after clicking the search button.
To resolve this problem, I guess I need to select by program level 1 in the table whenever the grid is charged, but I have not found a working method to do this.
You kindly explain how to select by program level 1 of an af:table?
Thank you
Federico
Hi Federico
only for research you can handle this in your action of the search button (because your selection listener code works for another action), after research get the current row of your table (it would be the first rows) and run your codeIf you are using af:query, then override default query listener to run custom code
Thank you
-
How can I only compact SOME of my e-mail folders?
(I have already studied this days and obtained conflicting information - and leading to my distrust horror stories.)
How do I compact ONLY SOME of my folders (multiple email addresses)? A large part of my email is archival. I keep getting messages to clear disk space (I have more than 300 GB of available), but even after the DELETION of THOUSANDS OF E-MAILS, the amount of space to be clarified (?) increases. I tried setting up of new files, but I'm afraid of their compact because EVERY SINGLE ONE of my existing accounts shows the same message (you can delete up to - now 3.9 GB - of compaction space.) I need to make sure that ONLY PREVIOUSLY DELETED EMAILS will be compacted - and I keep seeing comments on your site people who compacted and LOST ALL OF THEIR EMAILS. (I can't tolerate what is happening to me). How to take care of this without losing important emails?
Thank you.Right-click on the folder, and then select Compact to individual records.
Most of the horror stories is people who do not compact on a basis regular. Compaction is a necessary maintenance task, and it must be done frequently. -
Photosmart HP 6520: how to select this format size for printer samsung Galaxy print hp 6520
How to select this format between Samsung Galaxy 3 score and HP Photosmart 6520 printing size.
Hello
If you haven't done so already, please download the Hp ePrint app and print them from the app. You will find options of lots within the app for selection of size and type of paper.
You must also download the HP Print plugin for android. Once downloaded, go to settings and turn it on. Once downloaded and activated, you will be given some options of paper size when you select print directly on your android device.
-
How do you center align some text in a text field?
How do you center align some text in a text field? Trying to create an editable field for a client, but need a centered text.
For this you must activate multiline text in the Options tab and formatting. If you then view the properties bar (Ctrl + E), you will be able to set the vertical alignment when the field has focus. You will need to click on the more button in the properties bar and then select the paragraph tab, and you will see where you can set the vertical alignment.
-
How to select the pieces of my image in black and white?
How to select the pieces of my image in black and white? FOW example letter J or the circle or the two together?
It's actually pretty easy, but I have to assume that you know a few basics in Photoshop
(1) open your existing image
(2) double click on the layer and the 'layer style' appears. In the mix if area set the sliders so the whites in the image disappears
You will be left with just the black elements in design
(3) duplicate layers
and merge them together
to give a standard layer
(4) ctrl or cmd click on the layer to select and create a layer mask
(5) you now have a mask of the image. Duplicate the layer, click alt or option, click on the layer mask to call
(6) the blacks and the whites are not completely black and white for the use of levels to adapt to the absolutes
(7) now you have to decide what you want to select. In this case, I chose the lettering and simply covered everything else to the top with black. You do this by lasso selection and fill and items when it's delicate brush just the details with a black brush "hard." .
(8) at this stage, you can do what you want you have a layer mask. So you can color the text for example
or place in a background color and apply a layer as Beveling effect
Hope that makes some sense. It is much easier to do than to describe.
-
I really need someone to help me. I tried to figure out how to select a PDF to convert a Word doc. When I go to select a PDF file, all that comes is the WORD documents. doesn't show ANY of my PDF files... Please help me understand what is happening? We put it on automatic renewal so I know it's not that we have not renewed this subscription, because we pay automatically.
Hi olivias,.
Looks like there may be some confusion on your system which application should be associated with PDF files. You can reset the file name associations by following the steps described in these articles (depending on your operating system):
How to change the default application for a file type. Macworld
http://Windows.Microsoft.com/en-us/Windows/change-default-programs#1TC=Windows-7
Please let us know if you have any additional questions.
Best,
Sara
Maybe you are looking for
-
Messages written in vertical mode
I can't get my screen to return to the vertical format when you type messages. The horizontal mode, previous messages sent are not noticeable as well. I find it embarrassing. I break something? Thank you.
-
For these last days, I can't send or receive messages/1 contact calls Skype. All the others are fine. I tried to remove and re-add the contact - no use. Even with blocking and non-blocking them. Any ideas on what to do? I am running the most updated
-
HP Simplepass allows not more than one fingerprint
Hi guys,. I have a HP ENVY 15-j112tx, I had now since the beginning of this year as a replacement for my TouchSmart from HP ENVY 15 - j009tx which broke down at Christmas. On my j009tx, I was able to attend several fingers, the software looked just l
-
Services of Blackberry Smartphones blackBerry using a Wi - Fi connection
I want to use my wifi for the use of services such as facebook, twitter, bbm,.. whatsapp blackberry etc (browser works) but it only works if my connection is EDGE but not edge and EDGE only appears when I'm on a data plan that costs money or only a m
-
Item change of line at the registration terminal State
Hello community!Any of you know if there is a way to change the line in terminal condition of registration information? Suppose that the user forgot to job information about the package entry in a contract file or the budget is there a way for the Ad