How to get the data in the format specified for this table?

Table:
ID     NAME     DESC1     COUNTRY_ID     PERFORMANCE

001     abc1     description 1     CON0000006       .67
001     abc2     descr2            CON0000004       1232.87
001     abc3     dsc3                     CON0000003        76798
002     abc4     descr4               CON0000005        8787
002     abc5     descr5              CON0000001        989.9989
003     abc6     dfrer                     CON0000001        676.90
003     abc7     ioioi                    CON0000001        6.8778
004     abc8     lilli                   CON0000001         334344
performance column is of type varchar2.

I want data like this:
ID     NAME     DESC1     COUNTRY_ID     PERFORMANCE
001     abc1     description 1     CON0000006       00.67
001     abc2     descr2            CON0000004       1232.87
001     abc3     dsc3                     CON0000003        76798.00
002     abc4     descr4               CON0000005        8787.00
002     abc5     descr5              CON0000001        989.99
003     abc6     dfrer                     CON0000001        676.90
003     abc7     ioioi                    CON0000001        6.87
004     abc8     lilli                   CON0000001         334344.00
I use oracle 10g on windows 7.
can you please how do I get the performance data in this format?

Try something like:

SQL> alter session set nls_numeric_characters='.,';

Session altered.

SQL> -- generating sample performance column
SQL> with t as (
  2  select '.67' perf from dual union
  3  select '1232.87' from dual union
  4  select '76798' from dual union
  5  select '8787' from dual union
  6  select '989.9989' from dual union
  7  select '676.90' from dual union
  8  select '6.8778' from dual union
  9  select '334344' from dual
 10  )
 11  --
 12  -- actual query:
 13  --
 14  select perf
 15  ,      to_char(trunc(to_number(perf), 2), 'fm999900.00') perf2
 16  from   t;

PERF     PERF2
-------- ----------
.67      00.67
1232.87  1232.87
334344   334344.00
6.8778   06.87
676.90   676.90
76798    76798.00
8787     8787.00
989.9989 989.99

8 rows selected.

Tags: Database

Similar Questions

  • HP laptop laptop 15-ac122TU: how to get the driver wifi for this computer

    I mistakely deleted the Realtek RTL8723be 802.11 wifi card software bgn. How can I install it back?

    Download and install the following driver

    https://www.google.nl/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&cad=rja&uact=8&sqi=2&ved=0ahUKEwiSk7jH_P7KAhXlQJoKHb64AaIQFgg4MAI&url=http%3A%2F%2Fh20564.www2.hp.com%2Fhpsc%2Fswd%2Fpublic%2Fdetail%3FswItemId%3Dob_151589_1&usg=AFQjCNHNhxhnxDPnAd887BzDqdnXpvOZzg&bvm=bv.114195076,d.bGs

  • How to get the string (specified by row and column) of txt file with labview

    Hello world

    How to get the string (specified by row and column) of txt file with labview

    THX

    As far as I know, a text file has no column.  Be more specific.  Do you mean something like the 5th word on line 4, where the words are separated by a space, and lines are separated by a newline character?  You can read from the spreadsheet String function and set the delimiter to a space.  This will produce a 2D channels table.  Then use the table to index and give the line number and column number.

  • How to get the code produced for my Windows XP disc if I have the drive?

    Acquisition of Product Code Windows XP

    How to get the code produced for my Windows XP disc if I have the drive?  I signed the BONE when I bought it all first, but have no way of knowing if this is the way to receive a copy of the product key.

    Here are some utilities, which will display your product keys:

    Belarc Advisor: http://www.belarc.com/free_download.html
    (He did a good job of providing a wealth of information.
    However may not detect a key to office, then try one of the other two below)

    Also: http://www.nirsoft.net/utils/product_cd_key_viewer.html
    and: http://www.magicaljellybean.com/keyfinder.shtml

    Paid (free demo is available): Recover Keys: http://recover-keys.com/
    "quickly scans your system for more than 3000 + software '.
    and produces a list of software activation keys.

    13 keyfinder programs:
    http://pcsupport.about.com/od/productkeysactivation/TP/topkeyfinder.htm

    J W Stuart: http://www.pagestart.com

  • How to get the device model, for example app works on PlayBoook or BlackBerry 10?

    How to get the device model, for example app works on PlayBoook or BlackBerry 10?

    You can use this class: http://goo.gl/GtMLP for information on devices

    something like this:

    String myDeviceModel = android.os.Build.MODEL;
    String myDeviceBrand = android.os.Build.BRAND;
    String myDeviceDevice = android.os.Build.DEVICE;
    
  • How to find the child level for each table in a relational model?

    Earthlings,

    I need your help, and I know that, "Yes, we can change." Change this thread to a question answered.

    So: How to find the child level for each table in a relational model?

    I have a database of relacional (9.2), all right?
    .
         O /* This is a child who makes N references to each of the follow N parent tables (here: three), and so on. */
        /↑\ Fks
       O"O O" <-- level 2 for first table (circle)
      /↑\ Fks
    "o"o"o" <-- level 1 for middle table (circle)
       ↑ Fk
      "º"
    Tips:
    -Each circle represents a table;
    -Red no tables have foreign key
    -the picture on the front line of tree, for example, a level 3, but when 3 becomes N? How is N? That is the question.

    I started to think about the following:

    First of all, I need to know how to take the kids:
    select distinct child.table_name child
      from all_cons_columns father
      join all_cons_columns child
     using (owner, position)
      join (select child.owner,
                   child.constraint_name fk,
                   child.table_name child,
                   child.r_constraint_name pk,
                   father.table_name father
              from all_constraints father, all_constraints child
             where child.r_owner = father.owner
               and child.r_constraint_name = father.constraint_name
               and father.constraint_type in ('P', 'U')
               and child.constraint_type = 'R'
               and child.owner = 'OWNER') aux
     using (owner)
     where child.constraint_name = aux.fk
       and child.table_name = aux.child
       and father.constraint_name = aux.pk
       and father.table_name = aux.father;
    Thought...
    We will share!

    Thanks in advance,
    Philips

    Published by: BluShadow on April 1st, 2011 15:08
    formatting of code and hierarchy for readbility

    Have you looked to see if there is a cycle in the graph of dependence? Is there a table that has a foreign key to B and B has a back of A foreign key?

    SQL> create table my_emp (
      2    emp_id number primary key,
      3    emp_name varchar2(10),
      4    manager_id number
      5  );
    
    Table created.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  create table my_mgr (
      2    manager_id number primary key,
      3    employee_id number references my_emp( emp_id ),
      4    purchasing_authority number
      5* )
    SQL> /
    
    Table created.
    
    SQL> alter table my_emp
      2    add constraint fk_emp_mgr foreign key( manager_id )
      3         references my_mgr( manager_id );
    
    Table altered.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1   select level lvl,
      2          child_table_name,
      3          sys_connect_by_path( child_table_name, '/' ) path
      4     from (select parent.table_name      parent_table_name,
      5                  parent.constraint_name parent_constraint_name,
      6                  child.table_name        child_table_name,
      7                  child.constraint_name   child_constraint_name
      8             from user_constraints parent,
      9                  user_constraints child
     10            where child.constraint_type = 'R'
     11              and parent.constraint_type = 'P'
     12              and child.r_constraint_name = parent.constraint_name
     13           union all
     14           select null,
     15                  null,
     16                  table_name,
     17                  constraint_name
     18             from user_constraints
     19            where constraint_type = 'P')
     20    start with child_table_name = 'MY_EMP'
     21*  connect by prior child_table_name = parent_table_name
    SQL> /
    ERROR:
    ORA-01436: CONNECT BY loop in user data
    

    If you have a cycle, you have some problems.

    (1) it is a NOCYCLE keyword does not cause the error, but that probably requires an Oracle version which is not so far off support. I don't think it was available at the time 9.2 but I don't have anything old enough to test on

    SQL> ed
    Wrote file afiedt.buf
    
      1   select level lvl,
      2          child_table_name,
      3          sys_connect_by_path( child_table_name, '/' ) path
      4     from (select parent.table_name      parent_table_name,
      5                  parent.constraint_name parent_constraint_name,
      6                  child.table_name        child_table_name,
      7                  child.constraint_name   child_constraint_name
      8             from user_constraints parent,
      9                  user_constraints child
     10            where child.constraint_type = 'R'
     11              and parent.constraint_type = 'P'
     12              and child.r_constraint_name = parent.constraint_name
     13           union all
     14           select null,
     15                  null,
     16                  table_name,
     17                  constraint_name
     18             from user_constraints
     19            where constraint_type = 'P')
     20    start with child_table_name = 'MY_EMP'
     21*  connect by nocycle prior child_table_name = parent_table_name
    SQL> /
    
           LVL CHILD_TABLE_NAME               PATH
    ---------- ------------------------------ --------------------
             1 MY_EMP                         /MY_EMP
             2 MY_MGR                         /MY_EMP/MY_MGR
             1 MY_EMP                         /MY_EMP
             2 MY_MGR                         /MY_EMP/MY_MGR
    

    (2) If you try to write on a table and all of its constraints in a file and do it in a valid order, the entire solution is probably wrong. It is impossible, for example, to generate the DDL for MY_EMP and MY_DEPT such as all instructions for a table come first, and all the instructions for the other are generated second. So even if NOCYCLE to avoid the error, you would end up with an invalid DDL script. If that's the problem, I would rethink the approach.

    -Generate the DDL for all tables without constraint
    -Can generate the DDL for all primary key constraints
    -Can generate the DDL for all unique key constraints
    -Can generate the DDL for all foreign key constraints

    This is not solidarity all the DOF for a given in the file object. But the SQL will be radically simpler writing - there will be no need to even look at the dependency graph.

    Justin

  • I lost my product key for my anytime upgrade for windows is anyway to get the product key for this drive

    lost product key

    I lost my product key for my anytime upgrade for windows is anyway to get the product key for this drive

    See http://support.microsoft.com/kb/811224

  • Error 1079: "the account specified for this service is different from the account specified for other services in the Sun in the same process.

    Hello Sir

    customers start the dhcp service, I get an account of 1079 ACE ' the error specified for this service is different from the account specified for other services in the Sun in the same process.


    Go to start / all programs / accessories / Run.  Type netsh winsock reset catalog , and enter.  You may need to restart.  See if that fixes the problem.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • "The account specified for this service is different from the account specified for other services running in the same process" while trying to connect to the internet.

    Original title: the account specified for this service is different from the account specified for other services running in the same process

    while trying to connect to internet, I get the message "connection status: unknown the account specified for this service is different from the account specified for other services running in the same process" that you start happens out of the blue. When I run the diagnostic and repair tool it says that Windows cannot resolve the problem, contact admin or your ISP. I know that my internet service works very well. I am currently on an e-machine running Windows Vista Edition Home Premium and it connects without problems. My problem is that my most recent top of office (gateway also on Windows Vista Home Premium) receives connection problems. IM connected to the internet (DSL) with the ethernet cable from the Yukon. All the lights are green on the wireless gateway, so I know that the service is very good. Strange thing I noticed, when I go to network status and share and view Gateway desktop computer shows the "Yukon Ethernet controller" as the connection while the e-machine device says Im using "Intel (R) PRO/100VE Network Connection" Im using the same cable (Yukon) and put in place for both computers, so I was wondering what that was all too. Any help is appreciated.

    Hello

    Thank you for writing to Microsoft Communities. From your problem description, I understand that you can not connect to Internet.

    1. have there been recent changes to the computer before the show?

    2. the problem occurs in safe mode with networking?

    Please go ahead and follow the steps mentioned and later a update on the State of the question.

    Method 1: Wi - Fi and in Windows network connection issues:

    http://Windows.Microsoft.com/en-us/Windows/help/wireless-network-connection-problems-in-Windows?T1=Tab03

    Additional information:

    The problems of Internet connection:
    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-Internet-connection-problems

    Please follow these recommended steps and post if you still experience the problem.

  • Cannot start the services of ICF error 1079: the account specified for this service is different from the account specified for other services running in the same process

    Original title: I'm trying to start the Windows Firewall.

    I'm trying to start Windows Firewall services, (administrative control / tools/services/windowsfirewall Panel) and error 1079: the account specified for this service is different from the account specified for other services running in the same process, rises.  What should I do?

    Hello

    ·         You will remember to do recent changes on the computer before this problem?

    ·         Logged in as an administrator on the computer?

    I suggest you follow the steps mentioned below:

    Method 1:

    Follow the steps described in the following link and check if the problem persists:

    http://support.Microsoft.com/kb/2478117

    Method 2:

    If the previous step fails, run the System File Checker tool to troubleshoot missing or corrupted, system files proceed to the following link:

    http://support.Microsoft.com/kb/929833

    Method 3:

    If the previous step fails, set the center of security and its dependencies services to run under the Local Service account. Follow these steps:

    a. Click Start, type services.msc and press to enter.

    b. double-click Security Center, click on tab log.

    c. Select "this account", click on the Browse button, type Local Service and click ok.

    Type the password and confirm the password and click ok.

  • How to get the different records for the date max.

    Hi all

    Here is the sample sql for sample table and data.

    Create table student (dept_id number(10), first_name varchar2(10),last_name varchar2(10),join_date date,years_attended number(10));

    insert into student values (1,'Ann','Coleman',to_date('3/7/1917','MM/DD/YYYY'),4);
    insert into student values (1,'Ann','Coleman',to_date('3/7/1916','MM/DD/YYYY'),5);
    insert into student values (2,'Rock','Star',to_date('1/1/1920','MM/DD/YYYY'),5);
    insert into student values (2,'Rock','Star',to_date('1/1/1921','MM/DD/YYYY'),6);
    insert into student values (3,'Jack','Smith',to_date('7/1/1900','MM/DD/YYYY'),3);

    insert into student values (3,'Jack','Smith',to_date('7/1/1901','MM/DD/YYYY'),4);

    commit;

    I need to get maximum date records when the name and dep_id corresponds to. I wrote the query below and it becomes the expected result, but I'm not sure it's quite effective.

    SELECT s.dept_id, s.first_name,s.years_attended

    FROM (SELECT dept, MAX (join_date) join_date

    STUDENT GROUP BY dept_id) x

    Student JOIN s ON x.dept_id = s.dept_id AND x.join_date = s.join_date;

    This above query returns records like below, and this is the goal.

    DEPT_ID NAME YEARS_ATTENDED

    1                         Ann                                4

    2                         Rock                              6

    3                         Jack                              4

    Can you please let me know the query SQL I wrote is effective or not? This sample table may have less data, but I'm dealing with millions of records.

    Hello

    Thanks for posting CREATE TABLE and INSERT statement. This really helps.

    Here's a solution. I also added a name that seems logical. In which case you can delete:

    Select dept_id, first_name, last_name

    , max (years_attended) Dungeon years_attended (last dense_rank order by join_date)

    the student

    Group of dept_id, first_name, last_name;

    DEPT_ID FIRST_NAME LAST_NAME YEARS_ATTENDED

    ---------- ---------- ---------- --------------

    1 Ann Coleman 4

    Rock 2 star 6

    3 Jack Smith 4

    Kind regards.

    Alberto

  • Satellite L500-154 - how to get the software packaged for Win7

    How can I get the software "Bundled" for Win 7, I will install Win 7 full (no updates), in the moment is runing Vista on the laptop

    As far as I know, you can't have Win7 recovery media. Laptops ship with Vista can update only.

  • How to get the new update for the help and support

    OT:how to get the new update of the abd support help

    How to get help and support update

    Hello rickstemberger,

    Please click the number of the KB article for more information on how to add Windows Vista Help files.
    KB Article ID: 917607 -I can not open Help files that require the Windows Help program (WinHlp32.exe)

    Microsoft stopped including the 32-bit help files viewer in versions of Windows starting with Windows Vista and Windows Server 2008.
    However, with article 917607, you can download the appropriate version of the Windows Help program (WinHlp32.exe) and add them
    the operating system.

    Sincerely,

    Marilyn
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • How to force the format landscape for mobile devices (phone &amp; pad)?

    Hello, I am designing a new Web page in muse. It will be necessary for this layout, view the page in landscape format (mobile / ipad & iphone).  is there an opinion to force the format landscape for mobile devices? whereas even if the device is in portrait format, the site will be displayed in landscape format?  support told me that I will have to add the code. could you tell me the code and how do I insert this to my page? Thanks for your help

    This might help you:

    fixed vertical layout for mobile

  • How to get the last records of a Table

    Hey Geeks,

    I have this 'conflict '.

    I need to get the 'current balance' for each account, the newest "current_Balance".

    The table looks like this

    ACCOUNT_IDBUSINESS_TRANSACTION_IDCURRENT_BALANCETRANSACTION_AMOUNTTRANSACTION_DATE
    1 062 570238 043 51751'022-20'00031.03.2014 17:49:00.808000
    1 062 570238 042 40771'022-20'00031.03.2014 17:33:55.666000
    1 062 570238 042 36891'022-26'00031.03.2014 17:33:20.067000
    1 062 570238 041 273117'022-50,00031.03.2014 17:18:25.189000
    1 062 570238 041 174167'022-10,00031.03.2014 17:16:59.361000
    1 062 570238 038 702177'022-2'50031.03.2014 16:44:58.332000
    5 607 555238 046 7131'026-28'50031.03.2014 18:35:16.212000
    5 607 555238 040 59229'526-100,00031.03.2014 17:10:15.474000

    I need this result:

    ACCOUNT_ID CURRENT_BALANCE

    5 607 555 1'026

    1 062 570 51'022                   


    How we handle this?


    Thxs for your help


    Ineffective :-)

    SELECT Account_id

    MAX (current_balance) KEEP (DENSE_RANK LAST ORDER BY transaction_date) current_balance

    MAX (business_transaction_id) KEEP (DENSE_RANK LAST ORDER BY transaction_date) business_transaction_id

    Of account_balances

    GROUP BY account_id

    See on Oracle: clause to keep

    Concerning

    Marcus

Maybe you are looking for

  • Can I replicate folders of e-mail between devices

    I have several devices and use the e-mail and use gmail with an IMAP account.  I don't use gmail webmail. On my MBA, I created several folders so I can store emails specific to particular topics.  However, once I moved an email in the Inbox MBA in a

  • Disconnecting from drive external hard usb 3.0 on win 8.1 - HP Beats

    I have the special edition beats 15-p058n and my USB 3.0 WD My Passport which works fine on Windows 7 3.0 is connecting / disconnecting constantly every 10 seconds or more. I checked the internet and found that so many similar problems could be a com

  • Problem on the out of the loop For of Cluster

    Hello!  I'm using Labview 2009. I have a problem in the transmission of the indexed number of a loop through function array-cluster to a cluster. Please check my attachment... The problem is, he always says the number of items in the numbers indexed

  • Need help with laptop back to factory settings

    can someone help me on how to put my laptop back to factory settings

  • Several workplaces

    HelloI would like to work from 2 computers. Traveling with your laptop and home with your desktop computer. I thought that when I load the files on a cloud (Onedrive or creative cloud) that I can access it from any computer.If I linked items on my de