Is it possible to get this o/p in a query

Hello All,
is it possible to write a query for the output
SQL> select * from emp1;
EMPNO EMPNAME
100 AAA
222 BBB
333 CCC
444 DDD
SQL> select * from bank;
BANKID BANKNAME
1 ICICI
2 HDFC
3 SBI
4 SBH
SQL> select * from emp1_bank;
EMPNO BANKID
100 1
100 4
222 3
222 2
333 1
444 3
6 rows selected.
Now I want output like this
1 2 3 4
100 Y Y
222 Y Y
333 Y
444 Y

Hi,
create or replace function bank_head return varchar2 is
v_bankh varchar2(2000) :='';
begin
for i in (select bankname from bank order by bankid)
loop
v_bankh := v_bankh || substr(i.bankname,1,3) || ' ';
end loop;
return v_bankh;
end;
create or replace function bank_detl(p_empno number) return varchar2 is
v_bankc varchar2(2000);
cursor c1 is select bankid from bank;
v_id number;
begin
open c1;
for i in (select bankid from emp1_bank where empno=p_empno order by 1)
loop
loop
fetch c1 into v_id;
exit when c1%notfound;
if i.bankid = v_id then
v_bankc := v_bankc || ' Y ' || ' ';
exit;
else
v_bankc := v_bankc || ' ' || ' ';
end if;
end loop;
end loop;
close c1;
return v_bankc;
exception when others then
return null;
end;
1 select 'emp ',substr(bank_head,1,100) from dual
2 union all
3* select substr(to_char(empno),1,3),substr(bank_detl(empno),1,100) from emp1
SQL> /
'EMP SUBSTR(BANK_HEAD,1,100)
emp ICI HDF SBI SBH
100 Y Y
222 Y Y
333 Y
444 Y
It is Ok With you
Bye
chitta

Similar Messages

  • HT203167 Due to system error, I couldnt backup one of the purchased game. Is it possible for me to get this app free of cost again?

    Due to system error, I couldnt backup one of the purchased game. Is it possible to get this game free?

    Download Past Purchases
    http://support.apple.com/kb/HT2519

  • Need help getting this code to work

    I am trying to get this code to work using "if else statment" but it will only do the first part and not do the second part in the else statement. Can anyone help me out? Here is the code:
    var R1 = this.getField("Registration Fees1");
    var R2 = this.getField("Registration Fees2");
    var R3 = this.getField("Registration Fees3");
    var R4 = this.getField("Registration Fees4");
    var R0 = 0
    if (R0 == 0)
      event.value = Math.floor(R1.value);
    else
      event.value = Math.floor(R2.value + R3.value + R4.value);
    I did notice that if I fiddled around this this part:
    if (R0 == 0)
    sometimes I can get the second part to work but not the first. I need it to do either or and this is getting frustrating.
    I might also not even need "var R0 = 0". I put that there for the condition part. If that is what is causing the problem, I can take it out. But then what would the condition be? For this form, the default is 0 and then the calculation follows by user clicking on different prices. The first part is if they want to pay for the full conference and the second part is if they want to pay for either Monday, Tuesday or Wednesday or 2 of the 3 days. Is it possible to get this to work with both parts together? I am still stuck on getting just one or the other working. Any help would be greatly appreciated. Thanks in advance.

    I have posted this on another message board and a user by the name of gkaiseril offered this solution but it hasn't worked either.
    // all four days
    var R1 = this.getField("Registration Fees1").value;
    // Monday
    var R2 = this.getField("Registration Fees2").value;
    // Tuesday
    var R3 = this.getField("Registration Fees3").value;
    // Wednesday
    var R4 = this.getField("Registration Fees4").value;
    var Fee = 0
    event.value = ''; // default value
    if (R1 != 'Off') {
      Fee = Number(R1) + Fee;
    } else {
      if(R2 != 'Off') {
         Fee = Number(Fee) + R2;
      if(R3 != 'Off') {
         Fee += Number(R3);
      if(R4 != 'Off') {
         Fee = Number(R4) + Fee;
    event.value = Fee;

  • Is it possible to get intermediate info while running with the Ipod Nano 6th gen?

    In the store I was told that the Ipod Nano 6th gen would keep me informed every 500m or every km about my distance, average speed etc.
    The Ipod only tells me AFTER the run what my average speed etc was. Not during my run. Is there a possibility to get this info during my run? The store does not know the answer.

    Do you have the Spoken Feedback setting set to On under Settings -> Fitness on the iPod?
    B-rock

  • MacBook Pro battery had accumulated more than a 1000 charges, and stopped functioning unexpectedly. Went and got the battery replaced. Just saw that SMC Firmware 1.6 update deals with this. Possible to get my money back?

    MacBook Pro battery had accumulated more than a 1000 charges, and stopped functioning unexpectedly. Went and got the battery replaced. Just saw that SMC Firmware 1.6 update deals with this. Possible to get my money back?

    The firmware update corrects an error that may occur, however the techs would have checked the condition of the battery prior to installing a new one.  If the battery was questionable, the firmware update was really not too important.
    You can check the battery condition by going to the apple, left side of the menu bar, About This Mac, More Info, System Report, Hardware, Power and see what it says about Cycle Count, Condition, Capacity: Condition anything but Normal needs to be checked and may need to be replaced.
    The cycle count of 1,000 charge cycles is the typical life of a Lithium-Ion battery, the point at which the capacity drops to 80% of the as built capacity.

  • I cannot log into facebook. I get the following message: 404 Error - Not Found The resource you have requested could not be found on the server. There are many possible reasons for this. Either the file does not exist, there is an error in your request,

    I am not able to go to the facebook site. www.facebook.com is not working. I get the following error message. 404 Error - Not Found
    The resource you have requested could not be found on the server. There are many possible reasons for this. Either the file does not exist, there is an error in your request, or the file is not accessible in the requested directory. Please verify that:
    * You have used the proper case; requests ARE case-sensitive!
    * You have entered the URL correctly. (i.e. proper directory/filename)
    * You used the FULL URL. (i.e. proper file type: .html, .gif , .jpg, etc.)
    * You use a tilde (~) before user directories. (i.e. www.furcen.org/~jurann/ )
    * The user/file still exists on this server.
    I also get redirected to "Busca Google" when typing www.facebook.com in the address bar.
    == URL of affected sites ==
    http://facebook.com; buscagoogle.com

    I have the same problem and it does not have to do with firefox. Do you have any idea how to fix it through?

  • My operating system is windows 2002, how can i provide and anti-virus protection, is it possible to get help for this obsolete system?y

    is it possible to get an anti-virus program for an obsolete operating system. Mine is windows xp 2002. i can't download a compatible service pack to compensate for the anti-virus program that i have or the one available for download provided by my internet server. are there any free, or for purchase, downloads available for the system i have. The anti-virus product i have says that i must have a service pack 2. the current one on my computer is service pack 1. The anti-virus provided thru my internet carrier says that i must have windows 7 or enternet explorer of at least 6.0 or higher or FireFox 3.6 or better, but i'm unsucessful with any attempts i've tried. so is there any help or i'm i stuck with this old system until my finances improve for a better one?
    Thanks

    Unfortunately, there are many reasons why the PSE Editor might crash, and often it is hard to diagnose quickly the reason for the crash.   Here are some steps you can take to try to fix the problem:
    http://www.johnrellis.com/psedbtool/photoshopelements-6-7-faq.htm#_Troubleshooting_Editor_ crashes

  • Hi, recently I have been making a list of songs and now that I have all of the songs that I want my iTunes is telling me to answer security questions that I forget the answers to, is it possible to get rid if this?

    Hi, recently I have been making a list of songs and now that I have all of the songs that I want my iTunes is telling me to answer security questions that I forget the answers to, is it possible to get rid if this?

    Damian_2087 wrote:
    ... I forget the answers... is it possible to get rid if this?
    No.
    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • I have purchased a G3, because I am an apple fan. I want this a clean installation software provided. Only the link no longer works. Is there a possibility  to get the required software. I Preferably, the Dutch version, but if only the English it's okey

    I have purchased a G3, because I am an apple fan. I want this a clean installation software provided. Only the link no longer works. Is there a possibility  to get the required software. I Preferably, the Dutch version, but if only the English it's okey

    What model G3 is it? An iMac, a PowerMac, a MacBook, or a PowerBook? What is the processor (machine) speed?

  • So, I've taken my panasonic printer back to the shop and exchenged it for a Canon MF-4430. Alas... the generic drivers do not make it print. Is it possible to get drivers to make this canon printer work with my lovely Mac Book Pro Snow Leopard, 6.8?

    So, I've taken my panasonic printer back to the shop and exchenged it for a Canon MF-4430. Alas... the generic drivers do not make it print. Is it possible to get drivers to make this canon printer work with my lovely Mac Book Pro Snow Leopard, 6.8?

    I could not find a MF-4430 at the Canon site. Are you sure the model is correct? They have a MF4450. The Mac drivers are here:
    http://www.usa.canon.com/cusa/support/consumer/printers_multifunction/imageclass _series/imageclass_mf4450#DriversAndSoftware
    If you are sure you have a MF4430, look around the canon site for the drivers.

  • Is this possible to get back in ios 6.1.3 from ios 7.04?

    Is this possible to get back in ios 6.1.3 from ios7 ?

    Apple does not support downgrading the iOS. If there are edifice areas that are causing you problems you should ask about them on these forums and someone might be able to help. Let us know exactly what the problem is, what you might have done to correct it, and what, if any, error messages you received.

  • Is that possible to get data from the red trace in this BMP file

    I have an instrument, which only export image file. I want use labview to replot it and do some analysis. The image file is like attachment. Is that possible to get data from the red  trace in this BMP file via labview vis?
    Attachments:
    coax312.bmp ‏4741 KB

    I looks to me that 515 pixels represents 200 meters, so multiply the
    x-values by 0.3885 meters/pixel to get the true x-values.  I don't
    have enough information to scale the y-axis.
    Randall Pursley
    Attachments:
    Compute from BMP.vi ‏66 KB

  • HT4623 I have an IPad Model MC497LL with version 4.2.1 (8C148) where do I find system updates to get this device to the highest version possible for this model?

    I have an IPad Model MC497LL with version 4.2.1 (8C148) where do I find system updates to get this device to the highest version possible for this model?

    Go back to the article you asked this question from, ignore the instructions for updating it wirelessly, scroll down, and follow those for updating it from iTunes on a computer.
    (93330)

  • My daughter dropped her iPhone 4S. How much will it cost to get this repaired. Or is it possible to get a refurbished phone to replace hers?

    My daughter dropped her iPhone 4S. How much will it cost to get this repaired. Or is it possible to get a refurbished phone to replace hers?

    If you did not purchase AppleCare+, you should have to pay $199 to get your iPhone repaired.  Here's a citation:
    http://support.apple.com/kb/index?page=servicefaq&geo=United_States&product=ipho ne

  • I have removed every possible componet of Mozilla Firefox from my computer and I still get a message when I turn on my computer that Firefox had a problem and needed to close. How do I get this completely removed from my computer?

    I have removed every possible componet of Mozilla Firefox from my computer and I still get a message when I turn on my computer that Firefox had a problem and needed to close. How do I get this completely removed from my computer?

    See:
    * http://kb.mozillazine.org/Profile_backup
    You can transfer files from the old profile to that new profile (be careful not to copy corrupted files)<br />
    See:
    * http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

Maybe you are looking for

  • Syncing an Iphone with multiple Itunes accounts

    I recently traveled with my Iphone and when at my brother's place, I logged in to Itunes with my ID, purchased some tv shows for my daughter and was able to sync them to my phone. When I got home and synced with my own laptop, it told me it had to sy

  • OS 8.6 won't quit or restart after hard shutdown

    While testing a G3 266MHz beige mini tower running OS 8.6, the system hung and refused to shut down even when the power button was pressed and held, so I literally had to pull the plug. The operation it hung on was opening a folder containing a large

  • Group Policy/Program Compatibility Assistant/PCA

    Since installing an app that ran in build 9841 and 9860.  In build 9879, I'm get the PCA pop up.  Read up on how to turn off the PCA using GP but it doesn't work in W10TP. A little more reading and I disabled the PCA services and it still pops up! Fo

  • Raid 0 not functioning after 10.5.8 server update to raid version 2

    I have three, 2 drive raid zeros which have stopped mounting as raids in my desktop and in Disk utility after updating to Srver OS 10.5.8 and updating to Raid Version 2. The disks appear in Disk Utility with: Mount Point : Not Mounted Partion Type: A

  • Will Journals saved on iCloud remain after they're deleted on my iPad?

    I'm using iPhoto's at the moment and am having great fun with the Journals part of the app. However im not pleased with the image duplication which seems to be going on - but thats another thread! Anyway, I've synced my first Journal to iCloud and ev