What should be the query for this?
Hello world
My version of DB is
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi PL/SQL Release 10.2.0.1.0 - Production "CORE 10.2.0.1.0 Production" TNS for Linux: Version 10.2.0.1.0 - Production NLSRTL Version 10.2.0.1.0 - Production
The table creation script.
CREATE TABLE COUNTRY_SAMPLE ( COUNTRY_ID NUMBER(4,0), COUNTRY_SHORT_NAME VARCHAR2(10 BYTE), COUNTRY_FULL_NAME VARCHAR2(20 BYTE)) ;
The INSERT commands.
Insert into COUNTRY_SAMPLE (COUNTRY_ID,COUNTRY_SHORT_NAME,COUNTRY_FULL_NAME) values (1,'IND','INDIA'); Insert into COUNTRY_SAMPLE (COUNTRY_ID,COUNTRY_SHORT_NAME,COUNTRY_FULL_NAME) values (2,'PAK','PAKISTAN'); Insert into COUNTRY_SAMPLE (COUNTRY_ID,COUNTRY_SHORT_NAME,COUNTRY_FULL_NAME) values (3,'ENG','ENGLAND'); Insert into COUNTRY_SAMPLE (COUNTRY_ID,COUNTRY_SHORT_NAME,COUNTRY_FULL_NAME) values (4,'AUS','AUSTRALIA');
So, how pair these countries, so that they will appear something like this
IND, PAK
IND, ENG.
IND, AUS
-----------------------------------------
PAK, ENG
PAK, AUS
PAK, IND
and so on...
Kind regards
BS2012.
Cross join?
SQL > select a.country_short_name
2, b.country_short_name
3 country_sample one
4 cross
5 join country_sample b
where the 6 a.country_short_name! = b.country_short_name
7.
COUNTRY_SH COUNTRY_SH
---------- ----------
IND PAK
ENG IND
AUS IND
IND PAK
PAK ENG
PAK AUS
ENG IND
PAK ENG
ENG AUS
AUS IND
AUS PAK
AUS ENG
12 selected lines.
Tags: Database
Similar Questions
-
EventID: 1206 Event Source: Active Directory Web Services ADWS failed to determine whether the computer is a global catalog server. What will be the solution for this.
Hi K jtm,.
Your question of Windows is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please post your question in the TechNet Forum. You can follow the link to your question:
http://social.technet.Microsoft.com/forums/en/category/WindowsServer/ -
I want the query for this scenario will be someone help me?
I have two tables table of markets and purchase...
When a record is there in the market table, this means that pure Price shud be replaced by Mkt Price
When I take the records between two particular date
I shud get the mkt price if a record exists for a date between and to date in the table of mkt else I shud get price pure himself.
How can I do this?
Table Purchase
Code date pure price
A 2 01/01/2010
A 3 01/05/2010
A 4 10/01/2010
A 6 15/01/2010
B 15 15/01/20110
Table of markets
Code Date Mkt price
A 10 01/05/2010
A 5 01/12/2010
When I take the records between 01/01/2010 and 01/04/2010
my result should be as follows
A 2 01/01/2010
01/01/2010 and 01/10/2010
A 01/01/2010 * 10 *.
A 01/05/2010 * 10 *.
A 4 10/01/2010
01/01/2010 and 01/15/2010
A 01/01/2010 * 5 *.
A 01/05/2010 * 5 *.
01/10/2010 * 5 *.
A 6 15/01/2010
B 15 15/01/20110Try this... NVL may not work in a scenario... also, if date of purchase is greater than the date of the contract, then he should show the purchase price and no market prices.
PRAZY@11gR1> exec :from_date:='01/01/2010'; PL/SQL procedure successfully completed. Elapsed: 00:00:00.00 PRAZY@11gR1> exec :to_date:='04/01/2010'; PL/SQL procedure successfully completed. Elapsed: 00:00:00.00 select a.code,a.pur_date, case when pur_date <= mkt_date then DECODE(mkt_price,0,pur_price,mkt_price) else pur_price end price from purchase_table a left outer join ( select code,mkt_price,mkt_date from ( select code, mkt_price,mkt_date, row_number() over (partition by code order by mkt_date desc) rn from market_table where mkt_date between to_date(:from_date,'DD/MM/YYYY') and to_date(:to_date,'DD/MM/YYYY') ) where rn=1 ) b on a.code = b.code where a.pur_date between to_date(:from_date,'DD/MM/YYYY') and to_date(:to_date,'DD/MM/YYYY') order by a.code,a.pur_date / C PUR_DATE PRICE - --------- ---------- A 01-JAN-10 2 Elapsed: 00:00:00.00 PRAZY@11gR1> exec :to_date:='10/01/2010'; PL/SQL procedure successfully completed. Elapsed: 00:00:00.00 PRAZY@11gR1> / C PUR_DATE PRICE - --------- ---------- A 01-JAN-10 10 A 05-JAN-10 10 A 10-JAN-10 4 Elapsed: 00:00:00.00 PRAZY@11gR1> exec :to_date:='15/01/2010'; PL/SQL procedure successfully completed. Elapsed: 00:00:00.01 PRAZY@11gR1> / C PUR_DATE PRICE - --------- ---------- A 01-JAN-10 5 A 05-JAN-10 5 A 10-JAN-10 5 A 15-JAN-10 6 B 15-JAN-10 15 Elapsed: 00:00:00.01 PRAZY@11gR1>
Decode added printing the purchase price if the market price is 0.
HTH,
PrazyPublished by: Prazy on April 21, 2010 15:32
-
I made a site for my school with Muse. Now, I want to add some videos on the site. The youtube plugin will not work. It is said the plugin is blocked. What can be the reason?
Hello
Some associates of the son,
Impossible to incorporate and view YouTube videos to Muse: 'plugin blocked. "
plugin blocked to ship video youtube html?
Let me know if you have any question.
-
So what's in the future for this product after 7.06?
Going back to the administration of e-mail after two-year absence. I'm having a hard time finding any Oracle discussion on future plans for OCS, including messaging.
It's an interesting question. Given the long history of the different components of the platform, it is difficult to see the retired mail server.
Indices:
- There is a bug IDs that refer to a version 8.0.0.0 (of the e-mail server)
- There are other bug IDs that reference yet to be out of Convergence (v2 and v3) patch versions
- There is at least one bug ID on what backend LDAP is supported by the e-mail server after that ODSEE 11 g is retired
I also heard rumors and total conjecture on a total of alternative/alternative to Convergence from a 3rd party (IE not Oracle).
In the space of provider ISP/large mailboxes, there is not much choice for banks to messages "carrier-grade" backend: Zimbra, OX, OpenWave and this platform. It is so difficult to see it go, but it is equally difficult to see that it is never a serious framework for Oracle.
-
What should be the compatibility for windows 7 32 bit setting
Recently, my computer guy me from Internet Explorer to Firefox. Since then, I had problems with the computer overheating. In my view, it relates to the Flash player used to play games on facebook. I researched and found others have had problems with that also. In my research, I looked properties Firefox and found that the compatibility settings display Windows xpService Pack 3 and wonder why the setting is not Windows 7.
I researched and found the CPU is much higher percentage and my computer overheats certainly when I use the flash player, play games. Properties setting may be wrong and would that be the problem. If this isn't the case, any suggestion would be appreciated. Thank you
Philipp... When I looked at the setting... .even though he said XP box has not been checked, and so I would like to now since you said that... assume it was not implemented... so I'll leave it as it is... not checked for nothing... I guess that part is a false problem... Thanks a lot for your help... Diane
-
I'm not a COMPUTER expert. I get: "mime or video format type is not supported" as a message on a webcam live feed Web site: chaturbate. What should I download to fix this problem?
Thank you
Collin
Flow cam I looked all used Adobe Flash Player.
Flash appears as a plugin installed in your system details.
-
Ideas:
- You have problems with programs
- I get error code 800F0825 when the computer attempts to install the update to vista KB938371. What should I do to fix this? messages
- Recent changes to your computer
- What you have already tried to solve the problem
Remember - this is a public forum so never post private information such as numbers of mail or telephone!
Backup of personal data (which none should be considered 100% reliable at this point) then do a format and clean install of Windows. Please note that a repair installation (upgrade AKA on-site) will NOT fix it!
Once installed the clean, you will have the equivalent of a "new computer" in order to take care of everything on the next page before connecting the machine to the internet or a network otherwise and before using a USB key that is not brand new, or has not been freshly formatted:
5 steps to help protect your new computer before going online
http://www.Microsoft.com/protect/computer/advanced/XPPC.mspxOther useful references include:
Measures to help prevent spyware
http://www.Microsoft.com/security/spyware/prevent.aspxMeasures to help prevent computer worms
http://www.Microsoft.com/security/worms/prevent.aspxAvoid fake security software!
http://www.Microsoft.com/security/antivirus/rogue.aspx~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft
-
I AM UPDATING MY COMPUTER AS OFTEN AS I CAN AND IT CROSSES THE PROSSES TOGETHER AND AT THE END IT SAYS UPDATE FAILD WHY? WHAT SHOULD I DO TO FIX THIS
Quote your full version of Windows (for example, WinXP SP3;) Vista 64 - bit SP2; Win7 RC. Win7) when you post in a forum or a newsgroup. Please do it in your next reply.
How to fix Windows Update, Microsoft Update and Windows Server Update Services installation issues:
http://support.Microsoft.com/kb/9066021. see the "need help?" Tell us what problem you are having"section of http://support.microsoft.com/ph/6527
2. you cannot install some programs or updates
http://support.Microsoft.com/kb/8227983. check your WindowsUpdate.log (% windir%\WindowsUpdate.log) to find errors associated with the download/install.
How to read the WindowsUpdate.log file
http://support.Microsoft.com/kb/9020933 b. errors compared to those listed here: http://www.bleepingcomputer.com/blogs/mowgreen/index.php?showentry=1122 or go tohttp://windowsupdate.microsoft.com > click on help and Support link in the left pane > solve problems on your own.
================
How to reset the Windows Update settings?
http://support.Microsoft.com/kb/971058================
Visit the Microsoft Solution Center and antivirus security for resources and tools to keep your PC safe and healthy. If you have problems with the installation of the update itself, visit the Microsoft Update Support for resources and tools to keep your PC updated with the latest updates.
~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft
-
Five of the six updates have been installed correctly, KB2698365 failed with error code 80070570. What should I do to install this important update successfully. I'm not a pc expert and don't have no knowledge will take it the word of experts from the pc. KB2698365 is 'important', so I tried to install it several times, but always failing with error code 80070570. I've been on a boring treasure hunt for to install this 'important' update, it seems to find no will to give helpful advice anywhere. I would appreciate help installation of this major update, and talk about normal advice, how to install it successfully without failure of the error code 80070570. What is the error code 80070570.? I use windows vista Home premium, service pack 2, 32-bit operating system. I'm using the essentials of security. Thank you for the consideration of this issue. NIC
Hi, Grizzly7659,
Follow the instructions given by Taurian & guenoun
-
Opengl32.dll is not designed to run on windows or it contains an error. I reinstalled the graphics drivers. During the execution of the games, it shows this error. What should I do to fix this? Is it a graphic file or a file from microsoft?
Hi Jason,
1. What is the number of brand and model of your system and graphics card?
2 did you a recent software or hardware changes to the system?
This error can be caused by an application, including any old games you have installed on your system.
Because you tried to reinstall the drivers for video card, you can try to perform a clean boot and check if it helps.
A clean boot to check if startup item or services to third-party application is causing this issue.
You can read the following article to put the computer in a clean boot:
How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
Note: After troubleshooting, be sure to set the computer to start as usual as mentioned in step 7 in the above article.
-
Hello, I was wondering: the FTP box fill, what should I type here for example: what user name? My username from my Web host? Or the username of Muse? Advice would be really appreciated - thanks in advance!
This would be information provided by your hosting provider.
-
Like the above statement, I get this error message, "could not not use the tool pen because of a program error." What should I do to fix this? I use PhotoshopCC a lot for work, so if someone could help me quickly, I would be grateful.
Please read this and acts accordingly (restoration of preferences after making sure all custom presets, actions, patterns, brushes etc. have been registered may be of special interest):
-
When FF starts, the file, edit, etc. line does not appear. What should I do to display this line?
Bill
This has happened
Each time Firefox opened
== I upgraded to FF 3.6
You are welcome.
-
Despite the removal of everything on my iPhone, it displays always remember. I deleted all the photos. No photo stream. removed from the recently deleted as well. Have also removed all the songs and most of the applications. But the problem persists. What should I do to fix this problem?
You happen to have Whatsapp on your device? If so, its last update caused several questions on the iPhones of the peoples. Delete the app and reset the phone in now the home and sleep/wake set buttons until you see the Apple journal and then release. Make sure you check in your conversations. Do not install Whatsapp again until they release a fix.
Maybe you are looking for
-
one photobucket click does not work in firefox. How can I fix this?
When I click on the photo in the album to make it full size that I can not use the click function to copy the links when I use Firefox. Click present works in Internet Explorer, but not Firefox. Is there any kind of fix for this? I would rather use F
-
Satellite Pro M30 - download drivers?
Hello world I hope someone is able to help me: I tried to find the drivers for my laptop on this site here, given that my original CD with the top drivers is lost. I was able to get to the section pilots where I entered the serial number of my laptop
-
What are the choices of Sony Docking Station for a Sony VAIO VPCSE27RX/B computer laptop 15.6 "?
-
Lakeshore temperature controller
Hello Forum, I downloaded the drivers for Lakeshore 331 temperature controller and I'm trying to implement, without success. (I'm a time-out error to my VISA playback function). So, I used my base series write and Read.vi to check if the cables and p
-
Password reset BIOS HP Pavilion dv4 4172la
I forgot the bios password and I need to get into the bios menu to change some configurationsmy laptop is a HP Pavilion dv4 4172lathe OS is windows 7 64the code appeared is: 62023458 someone knows how can I reset the password?