Space out the largest of two padding values dynamically?

11g

Hello world

I have two requests.

Select product_cost into v_pc from table1

and

Select sale_cost in the v_sc of table 1

Depending on what number is great, I have to add that many spaces such as the two points are aligned to the right. (it is a requirement in the Apex)

for example

If v_pc = 12345 and v_sc = 1234

then the output of the query must be

v_pc: = 12345

v_sc: = X 1234 - where x is actually a 'white space '.

Any suggesstions on how to do this. Can be sql or pl/sql that is easy.

Thank you

Ryan

SQL> select * from t;

PRODUCT_COST SALES_COST
------------ ----------
         100         10
   123456789      12345
         123    1234567

SQL> select '"' || lpad(product_cost, greatest(length(product_cost), length(sales_cost)), ' ') || '"' product_cost
  2       , '"' || lpad(sales_cost  , greatest(length(product_cost), length(sales_cost)), ' ') || '"' sales_cost
  3    from t;

PRODUCT_COST         SALES_COST
-------------------- --------------------
"100"                " 10"
"123456789"          "    12345"
"    123"            "1234567"

SQL>

Tags: Database

Similar Questions

  • How to space out the lines of text more closely

    Just upgraded (?) FF25 and lines between the text (the ' leader' in the terminology of the police of my favorites) and other lists are widely spaced. It is really difficult to read and should be condensed. Anyone has an idea on how to achieve this? I checked all the customizable options with no result. Thank you.

    O.M.G. as they say. Everything worked and therefore all simply! Followed every step, following the instructions, and he was there - a normal list of bookmarks and the list of history, etc.. It's pretty gold, and you know your stuff. I really appreciate your help. Thanks, jscher!

  • How to find this value in the oracle database to find out the table

    Hi expert,

    I know there is a value in the oracle database, please show me how to find this value in the oracle database to find out the table that contains this value.

    Thank you very much

    918440 wrote:
    Hi expert,

    I know there is a value in the oracle database, please show me how to find this value in the oracle database to find out the table that contains this value.

    Thank you very much

    Go to the online documentation and discover the data dictionary. You may be interested in reading about ALL_TAB_COLUMNS, but you will need to know what you want until you can query the view to find information

  • Is it possible to return the largest (highest) value in a range of values (not only the higher of the two values)?

    HI -.

    waiting for the Maximum()< x >, < y >) function to have the ability to determine the largest more of two values.

    EG - Maximum()< x > < y >, < z >)

    Is there another way to do this (without a custom function)?

    Thank you, James.

    With independent attributes (i.e. X, Y and Z are not the values of the attribute even through a set of entities), each attribute must be explicitly referenced and the simplest solution is to nest calls to competition.
    For example: Maximum (, Maximum (,))

    Do the same with an arbitrary number of values of attributes associated with the same entity (i.e. 'age in years' as an attribute of 'person') you can use the InstanceMaximum or equivalents of natural language that returns more high/more recent value of an attribute from entity level all instances of the entity.

    InstanceMaximum (, )

    who is the most recent for all [of]

    who is the greatest for all [of]

    last of all for

    the largest of for (all of | all | )

    There are also the following to constrain the set of instances of entity to a subset based on a condition and get the most out of this subset (i.e. ' age where the person is a woman')

    InstanceMaximumIf (, , )

    who is the most recent for all [of] for which it is true that

    who is the greatest for all [of] for which it is true that

    the largest of for (all of | all | ) for which it is true that


    A similar feature exists for at least and the sum.  See the Guide to political use of automation for details and examples.

  • How to find the largest contiguous free space in windows xp

    Hi, I have two machines, one running Win7, XP running.  I know how my highest contiguous free space is great under w7, using "defrag c: - one" in a prompt "administrator-started":

    C:\Windows\System32>defrag c: - one
    Microsoft Disk Defragmenter
    Copyright (c) 2007 Microsoft Corp.

    Citing analysis on OS (C :)...)

    The operation completed successfully.

    Post report of defragmentation:

    Volume information:
    Volume size = 283,40 GB
    Space free = 60.49 GB
    Fragmented space total = 0%
    More large size of free space = 46,29 GB

    But, by using the same command in XP does not have the same statistics (I tried 'defrag c: - a - v' for a detailed report, but it does not always give this stat.)  Anyone know how to find out what is the largest contiguous amount of free space on a XP computer?

    TIA

    K

    Hey man follow my link http://us.generation-nt.com/answer/how-find-largest-contiguous-block-free-memory-help-27343152.html , and it explains how to find this information. so, this should be your answer

  • Dv9008nr what is the largest hard drive internal, it will support? Including the two Bay drive.

    I have a laptop model Hp Pavilion Dv9008nr I have buy a new sata model Reader 2.5 500 GB seagate momentus.  I installed the player NDDN hard drive Bay, but the computer will not recognize and does not start in windows.  so I used Acronis to clone an image of the original disc with bootable operating systems so it clone for the Seagate 500 GB drive I reinstalled to drive Bay 1, but it still won't start. I have a vontacted HP support level 1 level 2 they say this computer supports a maximum of 200 GB of disc or 100 GB in each Bay.  I find it hard to believe when I search on the net and see the same model with 250 GB drives and 320 GB can someone explain or help thanks.

    I just let everyone know that I understood how to do this job. NO thanks to HP CUSTOMER SUPPORT level 1, level 2 or CAT.  They all told me that it was a problem of motherboard and BIOS and software was not the problem.  They stated that this series to DV9000 motherboard only can support a total of 200 GB of total disk space. It is 100 GB in drive Bay 1 and 100 GB of disk bay2, or 120 GB bay1 and 80 GB in bay 2.  I found that hard to believe. But still, they sent me the manual and showed me to page 123 this is everything that is supported.  They suggest to buy a new computer or use the external drive.

    HERE IS THE SOLUTION > I bought Acronis True Image 2009.  I remembered that a friend said that I must have the largest disk in drive Bay 1 and the same size or more small disk in drive Bay 2.  So, I took the 100 GB original out of the drive Bay 1 and installed in the 2 Bay drive. I then installed a new Western Digital 320 GB drive to bay1.  I rebooted the computer using the Acronis boot disk I had done.  Then, I used Acronis to create a disk image of my 100 GB drive Clone original with OS to the new 320 GB drive Bay 1.  After that the clone was complete I took out the boot disk and restatred windows and wow it worked fine.  I now have primary disk of 320 GB with the full image in reader1 and old 100 GB in drive 2.  That's a total of 420 GB on the motherboard which supposedly does not support.  I then decided to try this again then I removed the original 100 GB drive and then the clone bootable from 320 to drive Bay 2.  I then installed a new 500 GB Seagate Maximus drive dirve Bay 1. I then started with the Acronis boot idisk and cloned the 320 GB drive in the drive Bay 2 the new 500 GB drive Bay 1.  I have restart after taking the Acronis boot disk and, once again, I am now running windows with a disk of 500 GB primary with OS and all programs as well as 320 GB drive in Bay 2.  The two will appear in my computer as well as in managing and disk management. I then reformat the drive of 320 GB to free up more storage space.  You can do the same thing or set up in the raid disk.  I hope that this helps eveyone, because now I have 820 GB of hard drive space internally, despite any erroneous information that I received from HP.  I wil gladly help someone through the steps if necessary.  Thanks for all the support out there!

  • "C" drive is quickly running out of space, and the figure of 10 GB are rapidly diminishing.

    I have Medion Akoya P6613 laptop running Windows 7

    Reader C says 10 GB to 299 gb is free - apparently quickly running out of space, and the figure of 10 GB fades quickly.

    All the work to record to external hard drive. All my documents saved on hard drive, so nothing is saved on the drive of the laptop.

    It is likely that I have actually run out of space?

    Is it possible that everything is telling me that I am out of space not run correctly due to a fault or other? Everything seems to work OK, just occasional crashes when you use Microsoft Office Outlook 2003.

    Someone suggested I have restore laptop to factory default settings. I don't know how to do this. I know I'm losing everything and am particularly worried about losing e-mail on Outlook files.

    What advice do you have?

    Hello

    This free program allows you to see what is taking place.

    http://www.Jam-software.com/treesize_free/

    Also check how much space system restore uses:

    http://Windows.Microsoft.com/en-us/Windows7/how-much-disk-space-does-System-Restore-require

    _____________________________________

    You can clean your hard drive using these two methods.

    "Delete files using Disk Cleanup"

    http://Windows.Microsoft.com/en-us/Windows/delete-files-using-disk-cleanup#delete-files-using-disk-cleanup=Windows-7

    Using the free CCleaner program:

    http://www.Piriform.com/CCleaner

    In NO case use the registry cleaning Option in CCleaner

    _____________________________________

    Download, install, update and scan your system with the free version of Malwarebytes AntiMalware:

    http://www.Malwarebytes.org/products/malwarebytes_free

    And Norton Backup, if you are using Norton, can do strange things with filling of hard drive space.

    See you soon.

  • Spaces between the values in the output

    Hi all

    I have a doubt, this is the scenario in the report.

    Try to display the names of channel which is a special category in the bottom of the report. The names are identified by the DESCR field in the <? FIELD? > tag, starting with a. (ex: A-SONY).
    But there are some other channels to come between the two, as the commercial channels. Comes it like that.
    <? FIELD? >
    <? DESCR? > A-SONY <? / DESCR? >
    <? / FIELD? >
    <? FIELD? >
    <? DESCR? > B-SPORTS <? / DESCR? >
    <? / FIELD? >
    <? FIELD? >
    <? DESCR? > A-STAR <? / DESCR? >
    <? / FIELD? >

    Now, when we display these values, it displays properly, but leaving a space between them, because it has other values in the meantime.
    Can we avoid this space?, this creates some alignment problems.

    Thanks in advance,
    Imtiaz.

    You can do it like below, so that it picks up the values beginning with 'A' alone

  • Nobody knows the largest available space supported for vmfs data store when creating a new form of vmfs data store a 3T lun mapped from FC storage.

    I traced a form of lun 3 t FC storage.

    And the project to create a vmfs on this lun, creating, data store, space available by default is 1024 G, no 3 t, so I guess that maybe some limitations.

    Anyone know? Thank you very much.

    Hello

    The limit is 2 TB - 512Bytes

    That 512 bytes is VERY important to remember.

    You will see that 1 TB as it roles once you exceed 2 tablespoons.

    As Anton suggested you can use two 1.5 TB LUN safely. However, you can in fact more than 500 GB LUNS or such. Will the LARGEST you can is not always the most efficient allocation of resources.

    Best regards

    Edward L. Haletky VMware communities user moderator, VMware vExpert 2009, url = http://www.virtualizationpractice.comvirtualization practical analyst [url]
    "Now available: url = http://www.astroarch.com/wiki/index.php/VMware_Virtual_Infrastructure_Security' VMware vSphere (TM) and Virtual Infrastructure Security: securing the virtual environment ' [url]
    Also available url = http://www.astroarch.com/wiki/index.php/VMWare_ESX_Server_in_the_Enterprise"VMWare ESX Server in the enterprise" [url]
    [url =http://www.astroarch.com/wiki/index.php/Blog_Roll] SearchVMware Pro [url] | URL = http://www.astroarch.com/blog Blue Gears [url] | URL = http://www.astroarch.com/wiki/index.php/Top_Virtualization_Security_Links Top security virtualization [url] links | URL = http://www.astroarch.com/wiki/index.php/Virtualization_Security_Round_Table_Podcast Virtualization Security Table round Podcast [url]

  • Does someone have a MagSafe 2 power adapter whose serial number is located inside the space where the two pins?

    Hi guys!

    I want to know if the power adapter of MagSafe2 that I just bought is genuine or counterfeit.

    I bought a MagSafe2 power adapter that has its serial number located inside the space where the two pins. Its model # is A1424. All the power MagSafe adapters I've seen always have serial number located under the round metal head big (I guess it's called head male or female?). Please see photo for reference.

    If any of you have or had any Apple Store, can you let me know?

    Thank you!

    My 85 Magsafe is exactly identical to your image.   It was 'inside the box' with a new MBP computer.

  • Take the time between two values

    Hi people,

    I have a problem and I know idea how to solve... I need help.

    The problem is I want to take the time between two values max as you can see in the chart.

    For example, in the image that I have add

    4.5 - 1 840 = 2.66

    And enter this value in the 'time between mostra '.

    It's that I want...

    But what I think is very complicated, because I don't know how to take the time correctly and does remove...

    Thank you very much

    Any solution?

    Hi jocuma,

    I tried something and hope that helps u.

    Just create two arrays of temperature and voltage. First of all, I'll get the value of the voltage when it is more of a certain value and that same index to get the value of time and store in the shift register.

    When I get the second higher than the limit value, I'll get time and subtract the previous value.

  • I ran out of free space on the hard drive how can I free up space

    My pc is freezing or locking up when I run a desktop wallpaper animated, so I defragment a saw that I was up to 20% freespace

    You can create more free space in C in carrying one of the measures suggested below.

    The default allocation for the restoration of the system is 12% on your C partition is more generous. I have them would be reduced by 700 MB. Make my computer right click on your icon, and select System Restore. Place the cursor on your C drive select settings but this time find the slider and drag it to the left until it shows 700 MB and output. When you get to the settings screen, click on apply and OK and leave.

    A flaw that might be useless which is for temporary internet files, especially if you keep no copies on the disk offline. Setting the default value is 3% of the walk. Depending on your attitude to copies offline, you could bring it to 1% or 2%. In Internet Explorer, select Tools, Internet Options, general, temporary Internet files, settings to make the change. At the same time, look at the number of days, the story stands.

    The default allocation for the basket is 10% of the disk. Change to 5%, which should be enough. In Windows Explorer hover over your Recycle Bin, right click and select Properties, Global and move the slider from 10% to 5%. However, try to let you become so complete that if it is complete and you delete a file by mistake it will bypass the Recycle Bin and have gone forever.

    If your drive is formatted as NTFS another potential gain arises with your operating system on your C drive. In the Windows directory of your C partition you will some uninstall files in your Windows folder in general: $NtServicePackUninstall$ and $NtUninstallKB282010$ etc. These files can be compressed or not compressed. If compressed text the name of the folder appears in blue. If these files are not compressed you can compress. Right-click on each folder and select Properties, general, advanced, and check the box before you compress contents to save disk space. On the general tab, you can see the winning amount by deducting the size on disk size. File compression is only an option on an NTFS formatted disk partition / partition.

    Select Start, all programs, accessories, System Tools, cleaning disk to emptying your trash, delete temporary Internet files and other selected options. I recommend also you click Other Options, System Restore and delete all but the last system restore point. Run Disk Defragmenter.

    Using the system restore option is most appropriate when your system is slow and you need to increase the free disk space on your C partition. If you have errors that could be solved by using the system restore to your system settings back to before the error occurred initially do not use this option.

    If more than one person uses the computer and they have their own user log you need to run Disk Cleanup in each user profile that you want to delete all the unwanted files.

    A better program of disk cleanup is cCleaner. Delete System Restore points may be important if you have little free disk space. The ability to delete them is one of the tools options. You can selectively remove those created in less important moments.

    cCleaner comes with a registry tool. Do not use this tool as any registry cleaner could lead to the creation of very difficult to resolve system errors.
    http://www.CCleaner.com/download

    What email program are you using?

  • Loss of disk space available every day as System Volume Information folder is the largest on my hard drive

    My PC is under Windows7 Home Premium... version 6.1... Build 7601... service pack 1.

    I have a 1 TB hard drive... 3 weeks ago, I've had approximately 813 gb free space... now, I have only 603 gb of free space. I noticed that the folder System Volume Information is passed to 209,53 Go. Don't know why this issue became so great. I lost about 5 to 20 GB of free space on the hard disk every day.

    The System Volume Information folder is the largest on my hard drive... Users folder is 43.38 GB... Windows folder is 31.89 GB... WinSxS folder is 15,18 GB.

    I installed a couple of applications in the last 6 months... Driver booster... Download App... and size of file.

    I didn't save my PC in the last 3 weeks because of this problem.

    The only application that I use for backup is MotoCast USB... it creates a backup of the SD card in my smartphone to my PC.  I've been backup card SD in my phone every 3-4 weeks for the past 2 years but never lost so much hard drive space until the last 3 weeks.

    Any suggestions?

    Vido84

    I suggest that you should the Zone Alarm Firewall and use Windows Firewall.

  • Spaces in line in Doc w / notes in the form of two or three lines of blank space will appear at the bottom of the body of the text

    I am writing a thesis with a lot of commit and annoyingly, often two or three lines of blank space will appear at the bottom of the body of the text (not the reference section) on a given page. Fiddling around with notes (increasing or decreasing their), or with the body, which is sometimes useful, but it's not ideal - I wouldn't need to change what I say artificially in order to use the space in the body of the text... Any help is appreciated.

    Hi Peter,.

    What application you use to write the thesis?

    If you use Microsoft Office word, then I suggest you to send this request in the dedicated forums for office for assistance. Here is a link to the forum:

    http://answers.Microsoft.com/en-us/Office/Forum/Word?tab=threads

  • How to find the difference "within weeks" between two date values?

    Hi all

    Jdev version 11.1.1.7.1

    I used two < af:inputDate > & a < af:inputText > < af:panelFormLayout > components. My requirement is, I want to display the difference of weeks between these two day values in the inputText component when the user clicks the shape.

    Any suggestion would be appreciated.

    Kind regards


    Novel

    You can use this method to get the number of days between the day and date, and then divided by 7 to get the number of weeks

    public static long getDifferenceDaysBetweenTwoDates (d1, d2 oracle.jbo.domain.Date oracle.jbo.domain.Date)

    {

    If (d1! = null & d2! = null)

    {

    return (d1.getValue () .getTime () - d2.getValue () .getTime ()) / (24 * 60 * 60 * 1000);

    }

    return 0;

    }

    Check - http://sameh-nassar.blogspot.in/2014/10/dealing-with-dates-in-java.html

    Ashish

Maybe you are looking for

  • Satellite P100-439 and Ubuntu 6.10-> no sound

    PCI: cannot allocate recource region 7 bridge 0000:00...PCI: cannot allocate recource region 8 of the bridge...PCI: cannot allocate recource region 9 of the bridge... USB 1-1: device not accepting address 2 not, error-71 I have no sound. (Sorry my ba

  • Pictures not loading library

    After the last update of system, the pictures don't load not my library. The photo library in the folder of images on my hard drive. When I launch the Photos app, I have the menu bar and nothing else. Preferences is gray. If I want the Option button

  • DLL and global variables

    OK, here's a strange problem.  I am very new to create the dll, so I don't know that I have just an installation problem. But I'm trying to pass a global variable of a host program to its attached DLL.  I got this job when I was the CVI 2014. I recen

  • mounted the new motherboard, the habit now XP re activate, message implies that it is a pirated copy.

    I re loaded XP SP1 and receipt message to say that I had 30 days to activate, so I better download SP3 first. Worked well. Tried to activate it and got the implicit message that the copy of XP has been hacked. Run the real software diagnoses and the

  • BBM cannot configure BBM for 9900

    When I hit the bbm, it says he "cannot configure bbm" (not enough wireless coverage or your connection to the wireless network is turned off)... so I can't click anything on the screen... Please help on what to do because almost 3 days that I can not