Replacing Name with the Respective Code

Hi,
I have one table called CodeName, which contains Code and Names of Products.
Eg: 1 Table
2 Chair
3 Car
I have another table called NamePrice, which contains Name of the products and their Price.
Eg: Table 495
Chair 250
Car 200000
My Requirement is to replace the Codes, instead of Names in NamePrice table, which should be compared from CodeName table.
Eg: 1 495
2 250
3 200000
I am new to SQL. I just want to know, can we use for loops or while loops to solve the above problem.
If not, how can we do ?
Please give me some links of SQL to learn it in online.
Regards
VaradhRAJAN

This?
with
code_name as
   (select 1 num, 'table' nm from dual union all
    select 2, 'chair' from dual union all
select 3, 'car' from dual),
name_price as
   (select 'table' nm, 495 pr from dual union all
select 'chair', 250 from dual union all
select 'car', 200000 from dual)
select cn.num, np.pr
from code_name cn, name_price np
where cn.nm = np.nm
       NUM         PR
         1        495
         2        250
         3     200000                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Drawing images gives 2 different results with the same code.

    Im adding my code on here, and its sort of long but ill try to explain it. Most of it you can ignore.
    Anyway i'm making a tree menu with only 1 level of expansion. So you have a TreeMenu object, and this object has some Branch classes. These Branch classes have Leaf classes. That is all. On the menu there is also a little box where you can click to expand and collapse each branch. if a branch is expanded, all of its leaves are shown. if it is collapsed only the branch name is shown.
    So far what I've described above works, there is a small scale compilable working program, that is alright. Theres just a few bugs to fix.
    A little feature of the tree is if a branch or a leaf is selected (has been clicked on in the past) it has a blue background. This sort of works. The branch names seem to work alright, and some of the leaves. However other if you run the example i provided you can click on Leaf 1, and it will be ok, but if you click on Leaf 2 then there blue background is twice as big as it should be. But for the rest, it works ok.
    This is weird to me because the same code handles any of these same situations. So it seems that i get 2 diferent results with the same code. If anyone would like to help heres some stuff you should know:
    You can ignore Leaf class, i dont think theres any errors in there.
    You can ignore just about all of Branch class except the update() method.
    You can ignore all of TreeMenu class except the inner MouseListener class might be useful.
    You can ignore TreeTester. Just the JFrame tester class.
    to run the code:
    javac TreeMenu.java
    java TreeMenu
    http://cs.ucsb.edu/~jsterling/treemenu.zip
    thanks.

    You make a good point Stefan but unfortunately I already checked that.  I have even copied the mapping (right click copy) and pasted it from the working Mapping to the bad Map (Paste) to make sure the context values were all the same.
    I also opened all the queues and compared the values in each.  All values match exactly except for the result(out) queue.
    In both tests I am using the same IDOC XML file. 
    These are the only differences I see.
    1.  The IDOC is exactly the same as far as I can tell but they come from two different source SWCV.  SAP APPL 4.7 and Steelcase_Procurement (ECC 6.0). 
    2.  The working map uses a local UDF.  The bad map calls the UDF from a Function Group.  Is there a Java version difference between the two?
    A better sample of the result queues look like this:
    Correct Result:
    Thickness of Glass: 20
    Height: 10
    Width: 5
    Length: 18
    Thickness of Glass: 10
    Height: 15
    Width: 8
    Length: 14
    Bad Result:
    Thickness of Glass: 20
    <null>
    <null>
    <null>
    Width: 5
    <null>
    <null>
    <null>
    I took this chance to redesign my Variant Config output to separate the characteristics/values, but I'm still bothered that I was unable to determine what would cause the differing values.
    Any ideas?
    Thanks,
    Matt

  • Please help me out with the function code of print option in module pool

    please help me out with the function code of print option in module pool, along with CASE condition.
    regards,
    asif

    Hi
    you can use the Function module
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING
        destination            = 'LP01'                       "'Printer name
        list_name              = 'TEST'
        list_text              = 'SUBMIT ... TO SAP-SPOOL'
        immediately            = ' '
        line_size              = '2000'
        no_dialog              = 'X'             "pass space to Pop screen for Print option
      IMPORTING
        out_parameters         = wa_pri_params
        valid                  = w_valid.
    "next call below things
      NEW-PAGE PRINT ON NO DIALOG PARAMETERS wa_pri_params.
         "and try to Print the values inside the new-page
      NEW-PAGE PRINT OFF.
    Prabhudas

  • When i try to back up my iphone 4 it says i cannot back it up with the error code -50

    when i try to back up my iphone 4 it says i cannot back it up with the error code -50? HELP

    If you are running Windows and it stops on the first stage of a sync then my suggestion is to uninstall AppleDeviceSupport version 2.0.1 and re-install 1.5.2.
    There are instruction here to do it on Windows 7 (see the first post):
    https://discussions.apple.com/thread/3280228?tstart=0
    Those instructions are to fix a different problem, but it fixes the problem with syncing devices stopping on the first stage (backing up the device) too. The AppleDeviceSupport 2.0.1 comes with Quicktime 7.7 and, I believe, the latest Safari version.
    I'm running XP, so used the Everything search program (http://www.voidtools.com/download.php) to find the directories with the AppleDeviceSupport installers (they have the extension .msi and the version in the directory name) and right-mouse-buttoned them to do the uninstall and install. Note you need a reboot afterwards. (Actually I just sorted out the service in the Service Manager, but that's a longer explaination and a reboot works fine).
    Hope that helps,
    John

  • Down load MWST records to with the tax code as before

    Hi All,
    I need to make some changes to the MWST tables in respect of a VAT rate increase in Spain due on 1st July.
    I would like to know how to down load MWST records to with the tax code as before?
    Aditya

    Hi Aditya
    You should create a new tax code for the new VAT rate; you should not change the rate for the existing code.  This is because you may need to post/correct transaction for the old rate after the change in rates.
    Data is stored in T683S.  Select where KALSM = your tax procedure, for Spain this will most likely be TAXES

  • Issue in printing the batch document with the T-code COPI

    Issue in printing the batch document with the T-code COPI.
    So Batch document is not printing not printing.
    Kindly help.

    I would suggest to read this blog as a starting point: Asking Good Questions in the SCN Discussion Spaces will help you get Good Answers
    then rephrase and enhance your question with some facts because in the moment it is not at all sufficient enough for anybody to help you further on your particular issue.
    I am even in doubt that you posted this issue in the right forum, has this PP transaction really something to do with ABAP Connectivity. Check the space overview page of ABAP Connectivity , under the picture you can read what this space is about.

  • I not so recently changed my email adress I associated with my Apple ID and my iCloud ID. My old email still shows up for iCloud, and won't let me change it to my new email. When I try to delete it and replace it with the proper email, it wants my passwor

    I not so recently changed my email adress I associated with my Apple ID and my iCloud ID. My old email still shows up for iCloud, and won't let me change it to my new email. When I try to delete it and replace it with the proper email, it wants my password, which it won't accept because it's an invalid username.

    I had this same issue and got it resolved very simply when I contacted Apple SUpport
    Go to https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/ and sign into your infomation
    > Go to Manage apple id and primary email address
    > Change it to the old apple id that your device is asking for
    > Save changes
    > Go to Settings > iCloud and sign out of the infomation
    > Go back to https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/
    > Change it back to the correct apple id
    > Go to the email address adn reverify the apple id
    > Sign back into iCloud on your device
    > Smile
    Article to back up my statement http://support.apple.com/kb/TS5223

  • I have a MacBook Pro 15.4" 2.53GHz Core 2 Duo (A1286) - Mid 2009 MC118LL/A and I think the MATSHITA DVD-R   UJ-868 is going out. Should I replace it with the exact same drive or is there a better one that is compatible?

    I have a MacBook Pro 15.4" 2.53GHz Core 2 Duo (A1286) - Mid 2009 MC118LL/A and I think the MATSHITA DVD-R   UJ-868 is going out. Should I replace it with the exact same drive or is there a better one that is compatible?

    I went to my local Apple store last weekend with a similar issue on my 2007 C2D MBP and they quoted me a price of around £60 (excluding VAT) to replace the optical drive. That's about the same price as the external optical drive a bought for my RMBP.
    Alternatively you could just buy a 3rd party external drive if you want to save cash but note that the external Apple superdrive is not compatible with MacBooks with built in optical drives.

  • My iphone / mac no longer recognize they are the same Itunes library.  When I try to sync my phone now, it wants to erase everything and replace it with the computers itunes library.  I have purchased items on the phone I don't want to erase

    My iphone / mac no longer recognize they are the same Itunes library.  When I try to sync my phone now, it wants to erase everything and replace it with the computers itunes library.  I have purchased items on the phone I don't want to erase them from the phone.  The phone backs up fine, but won't sync. 

    File>Devices>Transfer Purchases from "iPhone" and then sync.

  • Hi,I have made a new Apple ID and logged in on my phone, on settings, but the app store is still using my old one. How do I get rid of the old ID and replace it with the new one?

    Hi, I have made a new Apple ID and logged in on my phone, settings > iTunes & app stores, but the app store is still using my old Apple ID. How do I get rid of the old ID and replace it with the new one?

    HAYDONISRAD wrote:
    ...  Maybe I'll stick with hers for now :-)
    OR...
    You could use your preferred Apple ID from now on, but you can still access your purchased items such as music, movies, or software using your other Apple IDs.
    From Here   http://support.apple.com/kb/HE37
    I have multiple Apple IDs. Is there a way for me to merge them into a single Apple ID?

  • How do I remove an incorrect apple ID from an iPad and replace it with the correct one?

    How can I remove an incorrect Apple ID from my ipad and replace it with the correct one?

    Hello Shy guy,
    You can try this:
    1. Go to the iTunes Store or App Store
    2. Scroll down, there you will see Apple ID: "your email" (below Redeem and Send Gift)
    3. Tap on that button
    4. Tap on Sign Out
    Now you should be able to use another Apple ID.
    Cedric

  • Displaying Document Name With The Summary in a Single Column Using Document Library View.

    Hi All,
    I have a question that relates to SharePoint Document Library Views. I want to view the Documents name with the summary in a single column. Below image shows an example of it. I need this within a SharePoint Document Library. Also I want the height of the
    row to be increased more than the default height. I cannot figure it out how to do that? Could you someone help me to do this. I have inserted the Document Library as an App Part to the page. 
    So could you someone help me to solve this matter?
    Thanks and regards,
    Chiranthaka

    HI Chiranthaka,
    You can create DataView webpart using SPD and then modify the display template according to your need.
    http://deannaschneider.wordpress.com/2012/07/10/item-counts-dvwp-sp2010/
    Hope this will help to solve your problem.
    Best Regards,
    Brij K

  • How can i see if other accounts on my ipod touch with the serial code?

    How can i see if other accounts on my ipod touch with the serial code?

    What? If other accounts what?

  • I recently had my hard drive replaced and now iTunes won't allow me sync my iPhone without deleting all the media contents and replacing it with the existing library. Is there another way without erasing everything?

    I have already backed up my iPhone, yet it still will not allow me to move the contents of my phone onto my computer. Rather, it wants to delete everything off of my phone and replace it with the contents on my iTunes. Is there a way I can integrate both my iTunes and iPhone? There used to be autofill on iTunes, but I can no longer find it.

    Hello there, DollyVong.
    The following Knowledge Base article has great information and steps to follow on getting purchased content from your iOS device to your computer:
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer
    http://support.apple.com/kb/HT1848
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro D.

  • Tried to download 16.0.1 but got following message: A newer version named Firfox.app (15.0) already exists in this location. Do you want to replace it with the

    I have a MacBook 10.5.8 OS. I have been getting an auto update notice for updating my current version 15.0 to 16.0.1. Tried to download version16.0.1 from Firefox web but got following message: A newer version named Firfox.app (15.0) already exists in this location. Do you want to replace it with the one you are moving? How can this be if the current version on my mac is 15.0?

    Have you tried just using the built in updater to update firefox? [[Update Firefox to the latest version]]

Maybe you are looking for

  • Help me i put my ipod to restore its completed and it keeps going to the same thing.

    so i want to restored my ipod "Are you sure you want to restore the iPod "iPod" to its factory settings? All of your media and other data will be erased, and the newest version of the iPod software will be installed" I say okay . them its says prepar

  • Stuck on hand tool in InDesign 5.5

    My InDesign 5.5 is stuck on the Hand Tool locking me out of all other tools. Thoughts?

  • How do I change AWAY from fire fox home page? I want google...

    Ever since I allowed Fire Fox to update, my desk top was HI-JACKED to the Fire Fox desk top and DOES NOT allow me to restore my preferred desk top like [[www.getSPRINTfree.com]]

  • Backup and restore LMS 3.1

    We have cisco works LMS 3.1  and the server have very problems, we need format the server and reinstall the Cisco Works, when I doin backup and restore of data LMS We lost the licenses? or when we restore the data in the server we have the same licen

  • Cannot find installed CD drive

    my integrate DVD drive cannot be seen by the pc. It does not show up as being there in windows explorer a D: drive or indeed any other drive. Why is this. i can not eject it either. I have even replace the old unit with an identical new unit thinking