SELECT, can you help me explain this simple result please
Hi, I have semething that I can't explain with my knowledge of the subsoil of sql:T1 (number cu_id):
1
2
3
4
T2 (number cu_id):
3
4
5
6
-------------------------------------------------------
Select T1.cu_id from T1, T2 where T1.cu_id! = T2.cu_id;
which produces 14 lines, looking at the result I guess what is happening on such a cross join, can you help me understand how sql in doing so:
1
1
1
1
2
2
2
2
3
3
3
4
4
4
-----------------------------------------
While select T1.cu_id from T1, T2 where T1.cu_id = T2.cu_id; -* (with the equals sign) produces 2 rows, which is good for me
3
4
TX
T
Published by: trento on 26 May 2011 20:53
Published by: trento on May 26, 2011 20:54
Because it takes each T1 line and compares against T2 lines - essentially a loop in all lines.
SQL> explain plan for select t1.col_1 from t1, t2 where t1.col_1 != t2.col_1;
Explained.
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 1967407726
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 12 | 312 | 6 (0)| 00:00:01 |
| 1 | NESTED LOOPS | | 12 | 312 | 6 (0)| 00:00:01 |
| 2 | TABLE ACCESS FULL| T1 | 4 | 52 | 2 (0)| 00:00:01 |
|* 3 | TABLE ACCESS FULL| T2 | 3 | 39 | 1 (0)| 00:00:01 |
---------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
3 - filter("T1"."COL_1"<>"T2"."COL_1")
Note
-----
- dynamic sampling used for this statement
19 rows selected.
SQL>
What you should do is NOT IN operation:
SQL> explain plan for select t1.col_1 from t1 where col_1 not in (select col_1 from t2);
Explained.
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 895956251
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 13 | 4 (0)| 00:00:01 |
|* 1 | FILTER | | | | | |
| 2 | TABLE ACCESS FULL| T1 | 4 | 52 | 2 (0)| 00:00:01 |
|* 3 | TABLE ACCESS FULL| T2 | 4 | 52 | 2 (0)| 00:00:01 |
---------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter( NOT EXISTS (SELECT /*+ */ 0 FROM "T2" "T2" WHERE
LNNVL("COL_1"<>:B1)))
3 - filter(LNNVL("COL_1"<>:B1))
Note
-----
- dynamic sampling used for this statement
21 rows selected.
SQL> select t1.col_1 from t1 where col_1 not in (select col_1 from t2);
COL_1
----------
1
2
SQL>
Hemant K Collette
Tags: Database
Similar Questions
-
My Aero notebook will not be stopped correctly more and when I turn it on it said "it was not shut down properly. Can you help me resolve this you problem?
It runs on Microsoft Windows 7.I got messages saying something on a certificate.At the bottom I selected the hardware and the drivers, but I don't know if that's the problem.Hello
1. you receive an error message/code? If Yes, what is the exact full error message?
2 have you made changes on the computer before this problem?
3 does take more time to shut down the computer?
Follow the steps.
Method 1
To help resolve the error and other messages, you can start Windows by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.
http://support.Microsoft.com/kb/929135
Note: Follow step 7 to reset the computer to start as usual after the boot process.
Method 2
Run the fix since the articles and if it helps.There is a delay when you stop, restart or log off a computer that is running Windows 7 or Windows Server 2008 R2
http://support.Microsoft.com/kb/975777You can't do a computer that runs Windows 7 stops or sleep
http://support.Microsoft.com/kb/977307Run a virus with Microsoft Safety scanner scan and check if the computer is infected.Method 3: Microsoft Security Scanner free is a downloadable security tool that allows analysis at the application and helps remove viruses, spyware and other malicious software. It works with your current antivirus software.
http://www.Microsoft.com/security/scanner/en-us/default.aspx
Note: The Microsoft Safety Scanner ends 10 days after being downloaded. To restart a scan with the latest definitions of anti-malware, download and run the Microsoft Safety Scanner again.
Important: when running Scan disk hard if bad sectors are found on the hard drive when parsing tent repair this sector if all available on which data may be lost.You can also download & run Microsoft Security Essentials on your computer.
See the link: http://windows.microsoft.com/en-US/windows/products/security-essentialsResponse with more information to help you. -
Hello
Firefox does not load any website in a proper way. It loads the website, but not in an appropriate manner. It loads in the good column.
Another website are load appropriately.
Can you help me solve this problem?Thank you
You can try the following steps in case of problems with web pages:
You can reload webpages and ignore the cache to refresh potentially stale or corrupt.
- Hold down the SHIFT key and click the Reload button
- Press 'Ctrl + F5' or 'Ctrl + Shift + R' (Windows, Linux)
- Press 'Command + shift + R' (Mac)
Clear the cache and delete cookies only from Web sites that cause problems.
"Clear the Cache":
- Firefox/tools > Options > advanced > network > content caching Web: 'clear now '.
'Delete Cookies' sites causing problems:
- Firefox/tools > Options > privacy > "Use the custom settings for history" > Cookies: "show the Cookies".
Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem.
- Put yourself in the DEFAULT theme: Firefox/tools > Modules > appearance
- Do NOT click on the reset button on the startup window Mode safe
- https://support.Mozilla.org/KB/safe+mode
- https://support.Mozilla.org/KB/troubleshooting+extensions+and+themes
See also:
-
I recently buy iPhone 6 s he'S / has and unfortunately the glass of my phone was broken, is it possible to change a new and that I should pay the penalty or not? Can you help me solve this problem? Thank you
See http://www.apple.com/support/iphone/repair/screen-damage/.
-
Hello
I have the photomembership of creative cloud, but after the first month, I can't open any of the applications. It is saying that it cannot find any product on my adobe ID. Can you help me with this?
Thank you
I received help in the chat. Thank you very much
-
I can't get Adobe Lightroom updates to 6.0.1 to 6.3. I get the update of the message U44M2P28 error does not apply. Can you help me solve this problem?
Would you uninstall Lightroom and restart your computer, and then please follow mentioned below as follows:
1. first install Lightroom 6.0 from the link below:
2. upgrade to Lightroom 6.3 using the link below:
http://blogs.Adobe.com/lightroomjournal/2013/06/keeping-Lightroom-up-to-date.html#lrcc2015
~ Sarika
-
Im trying to download the creative cloud on my Mac but its gives me the error "Installation on case-sensitive volumes is not supported. Please choose a different volume for the installation. (Error code: 22) "can you help me with this please?
Try error "Unsupported of disks case-sensitive" or similar install error | Mac OS
-
I use Dreamweaver CS4 and can no longer connect to Device Central - can you help me with this?
I use Dreamweaver CS4 and can no longer connect to Device Central - can you help me with this?
Device Central was interrupted on 23 April 2012.
http://www.Adobe.com/products/devicecentral.html
And replaced with Adobe Edge inspect CC (for subscribers of cloud)
http://HTML.Adobe.com/edge/inspect/
Nancy O.
-
Flash player will not install on Windows XP using Opera. Adobe Flash Player 11.5.502.149 has downloaded to my computer. Opera is the browser in use. Can you help me solve this problem?
I have good news! I managed to install Adobe Flash Player 11 by going to my temporary download folder and remove Adobe Flash Player 11, I then downloaded it once more. This time it installed on my computer.
-
(cd ide) not installed in my bios boot
I can't reinstall clean my version of vista because my cd/dvd drive is not installed in my bios boot priority please can you help solve this problem
You added a new drive?
All the drivers are up to date?
Check the cables for loose connections.
Is it possible for you to do the following to reload the original Windows installation files?
Start > all programs
Select Samsung
Samsung Recovery Solution
Select "full restoration".
-or-
Restart Windows and the Samsung logo starts pressing F4 to access the recovery screen
This is a known problem in Samsung - see document - links products are not good
It is Support Center of Samsung - Re: HDD no detect does not issue
Click Troubleshoot utility (PS there is a pop up window)
http://www.Samsung.com/global/business/HDD/
Samsung also recommend OnTrack Disk Diagnostic. You can make a bootable floppy to advise data with this:
http://buyonline.Ontrack.com/ecom/fr...file=DC500.exe
And here is the other programs from Samsung. The creator of the Manager of disc is really of Ontrack and hosted by Samsung. It should work with any brand of hard drive.
http://www.Samsung.com/Products/Hard...file/Sutil.exe
http://www.Samsung.com/Products/Hard...Ile/SHDIAG.exe
http://www.Samsung.com/Products/Hard...il_creator.exe
http://www.Samsung.com/products/hard...DM_Creator.zip(Disk Manager link was not on the Samsung website with the exception of one who asked for the story of your life, but in trying different possibilities with links leading to other files, I finally found one that allowed a download without having to give everything and personal information.)
___Taken from the following thread - Elvandil response
-
Can you help me?
You install exactly in the same way you did the 1st time... Put your disc in the drive, and enter your serial number when asked
Download & install instructions https://forums.adobe.com/thread/2003339 can help
-includes a link to access a page to download the Adobe programs if you do not have a disk or drive
-Cloud desktop http://helpx.adobe.com/creative-cloud/help/creative-cloud-desktop.html
-Cloud Getting Started https://helpx.adobe.com/creative-cloud.html
-you will need to enter your original serial number during the installation for non-Cloud programs
- or kglad links in response to #1 here can help https://forums.adobe.com/thread/2081216
Also go to https://forums.adobe.com/community/creative_cloud/creative_cloud_faq
-
I have a card wifi of air by sprint 3g / 4g 250u can you tell me how to fix this situation.
Hello
Maybe this can help.
http://shop.Sprint.com/en/software_downloads/mobile_broadband/sierra_aircard_595u.shtml
Jack-MVP Windows Networking. WWW.EZLAN.NET
-
Images on the screen are HUGE. Can you help me with this?
The images on my screen are HUGE. I can't read a page without sweeping left and right. If I try to play a game, it is impossible, because the game does not appear. This has happened without any changes to the computer. In addition, several times when I go on Facebook, the police is so small I can't read, I have to click on 'zoom' and set it to 125 in order to read it. An example of how out of whack it is, when I turn on my computer, there is a circle of color just before the authentication page rises and this circle is now an oval. Please can someone give me detailed instructions on how to solve this problem. Don't forget I'm a novice on the computer and don't know most of the 'computer language' thank you very much in advance. LATER THAT DAY... Problem solved, thanks to you all.
Right-click on your desktop, click Customize, then click the bottom display settings and you can change the resolution in the new window that opens
-
Really basic alignment table help! Can you help me fix this?
Working on an assignment and half of my pages are like this one, where the table will not reach the Summit. can't understand why. A help would be so appreciated!
< ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""
" < html xmlns =" http://www.w3.org/1999/xhtml ">
< head >
< meta http-equiv = "Content-Type" content = text/html"; Charset = UTF-8 "/ >"
Home < title > < /title >
< style type = "text/css" >
<!--
{body
background-color: #b88898;
}
->
< / style > < / head >
< body >
< table width = "80%" border = "0" align = "center" cellpadding = "15" >
< b >
< td bordercolor = "#FFFFFF" > < img src = "menu.jpg" alt = "menu" width = "800" height = "310" border = "2" align = "top" well = "#Map" / > < table > "
< /tr >
< b >
< td align = "left" valign = "top" bgcolor = "#FFFFFF" > < img src = "images / questioned girl.jpg" alt = "interviewed girl" width = "500" height = "312" hspace = "20" hspace = "20" align = "left" / > for a downloadable file of my resume, please click < a href = "Resume.doc" > here < /a > < table >
< /tr >
< /table >
< name of the map 'Map' id = 'Card' = >
< area shape = "rect" coords = "417,5,509,43" href = "home.html" / > "
"< area shape ="rect"coords ="424,55,491,86"href =" bio.html"/ > < area shape ="rect"coords ="417,94,521,136"href =" interests.html "/ >
< area shape = "rect" coords = "406,145,520,188" href = "resume.html" / > "
< area shape = "rect" coords = "350,233,434,265" href = "references.html" / > "
< area shape = "poly" coords = "427 246" href = "#" / > < area shape = "rect" coords = "389,190,488,232" href = "crazy.html a little" / >
< / map > < / body >
< / html >
{body
background-color: #b88898;
margin: 0;
}
-
If I restart my browser everthing works very well for at least 5 minutes. When I watch several videos to youtube, the LAG comes back and the video begins to freeze aboud every second for just a fraction of a second. The sound is stil played properly it only affects the graphics...
After about 10 minutes watching videos, the whole browser gets lag. Sometimes when I type fonts appear only about a second later. Scrolling is also affected. A few minutes later everything is back to normal, but it' not always t like that?I don't know what to do, I already rebooted with disabled modules, but I did not notice any difference. My ati graphics card drivers are up to date and I have the problem with firefox, chrome works perfectly.
Best regards, Jan
The offset is now gone. Removal and reinstallation of the plugins and the deactivation of my modules to speed dial (which is sad cause I like them) fixed. I think that's their function to auto-update the previews leading the video shift.
Thank you very much for your quick response and your help. I appreciate it.
Maybe you are looking for
-
IPhone cannot be restored (IOS 10 update)
I downloaded the update of 10 new IOS on my Iphone 6s. Now, there is an Itunes logo on my screen. I have already connected my phone with Itunes but I can't restore... Help, please
-
You can import Contacts from Gmail in Firefox OS?
It seems that you can only import Contacts from a SIM or Facebook card. I guess that means that you can't import or synchronize the Contacts of Gmail. Is this correct?
-
I can't get homeshare bind iPhotos
I've updated my mac and iPhotos is different than it used to be when I got to my apple tv. For some reason, I can't identify a photo library even if I 26 000 digital photos available on my mac. More precisely: My Mac of 2009 vintage and does not al
-
Yupp tv missing app after the recent update
We have subscription Yupp tv on our Sony Bravia KDL46-EX620. This app has been missing since 11/13, and we are not able to access the programs. This happened after a recent refresh of internet content. We contacted Yupp tv several times and told us t
-
How can I write in a table cell (row, column appear) in a databae?
How can I write in a table cell (row, column appear) in a database using LabVIEW Database Toolkit? I use Ms Access. Suppose I have three columns in a table, I write 1 row of the 1st column, then 1st rank of the 3rd column. The problem I have is after