Please, help me to in wrirting this query

Hi all

I want to write a query using the standard emp table. But the power required is as

DEPTNO ename
10 smith
Alen
brand
RAM 20
Hanuman

So if deptno is the same for some employees, it must be printed only once

Any help is highly appreciated
SQL> select decode(row_number() over(partition by deptno order by ename),1, deptno, '') deptno,
  2         ename
  3    from emp
  4  /

    DEPTNO ENAME
---------- ----------
        10 CLARK
           KING
           MILLER
        20 ADAMS
           FORD
           JONES
           SCOTT
           SMITH
        30 ALLEN
           BLAKE
           JAMES
           MARTIN
           TURNER
           WARD

14 rows selected.

or simply in SQLPLUS for display purpose

SQL> break on deptno

SQL> select deptno, ename from emp order by deptno, ename
  2  /

    DEPTNO ENAME
---------- ----------
        10 CLARK
           KING
           MILLER
        20 ADAMS
           FORD
           JONES
           SCOTT
           SMITH
        30 ALLEN
           BLAKE
           JAMES
           MARTIN
           TURNER
           WARD

14 rows selected.

Published by: Karthick_Arp on June 1st, 2009 23:33

Tags: Database

Similar Questions

  • Error, please help me, how to handle this?

    Please help me, how to handle this? 2892 ArgumentException: the parameter: System.Net.Sockets.OverlappedAsyncResult is not valid. Use the object returned by the corresponding asynchronous Begin call. Parameter name: asyncResult: at System.Net.Security._SslStream.EndRead (IAsyncResult asyncResult) at?. (IAsyncResult) at System.Net.LazyAsyncResult.Complete (IntPtr userToken) at System.Threading.ExecutionContext.Run (ExecutionContext executionContext, ContextCallback callback, Object state) to the System.Net.ContextAwareResult.Complete (IntPtr userToken) at System.Net.LazyAsyncResult.ProtectedInvokeCallback (object result, IntPtr userToken) at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback (errorCode, UInt32, UInt32 numBytes, nativeOverlapped NativeOverlapped *) to System.Threading._IOCompletionCallback.PerformIOCompletionCallback (errorCode, UInt32, UInt32 numBytes, NativeOverlapped * pOVERLAP)

    It's not a usual mistake. Despite this, try this link to error.

    https://social.technet.Microsoft.com/search/en-us?query=NET.Sockets%20based.%20overlapped&AC=4#refinementChanges=&PageNumber=1&showMore=false

    Details of youre also treat, try .net cmd, opening type: netsh Winsock reset exit, restart the pc

  • When I open Firefox browser, I get music siren followed by arcade. Please help me get rid of this.

    This morning at 10: 30 PDT when I opened Firefox browser, I had a type arcade of its follow-up of a siren sound that will not go away until I closed Firefox. Please help me get rid of this annoying noise!

    This has happened

    Each time Firefox opened

    today is 2010-05-21

    This morning at 10: 30 PDT when I opened Firefox browser, I had a type arcade of its follow-up of a siren sound that will not go away until I closed Firefox. Please help me get rid of this annoying noise!

  • Please help me how to read this type of XML document that resids in clob

    Hello

    I am very new to this XML thing in the oracle. My question is I have the XML file that is stored in my table as the clob data type and I want to read this data XML file and insert them into different tables.
    We use a server Oracle version 9.2.0.2
    Any body can help me how to do this... It is very urgent. Here is the XML file that is stored in the table as a clob column.
    <? XML version = "1.0" encoding = "UTF-8"? >
    < base = 's1' id >
    < WalkList >
    < work >
    < WalkPath id = "wp1" >
    < debug >
    < name > < / name >
    < language > < / language >
    < / debug >
    < / WalkPath >
    < id Walker = "w1" >
    < debug > <!-include only when debug mode is on->
    < name > < / name >
    < language > < / language >
    < / debug >
    < / Walker >
    < UnidentifiedLocationList >
    < UnidentifiedLocation >
    < UnidentifiedRFID > < / UnidentifiedRFID >
    < sub > < / sub >
    < / UnidentifiedLocation >
    < UnidentifiedLocation >
    < UnidentifiedRFID > < / UnidentifiedRFID >
    < sub > < / sub >
    < / UnidentifiedLocation >
    < / UnidentifiedLocationList >
    < InspectedLocation id = "l1" > <!-WalkIn freezer->
    < > 0 x 00020001 RFID < / RFID >
    < sub > 25/05/2010 13:44:03 < / sub >
    < debug > <!-include only when debug mode is on->
    < name > < / name >
    < language > < / language >
    < / debug >
    < UnidentifiedInspectableItemList >
    < UnidentifiedInspectableItem >
    < UnidentifiedRFID > < / UnidentifiedRFID >
    < sub > < / sub >
    < / UnidentifiedInspectableItem >
    < UnidentifiedInspectableItem >
    < UnidentifiedRFID > < / UnidentifiedRFID >
    < sub > < / sub >
    < / UnidentifiedInspectableItem >
    < / UnidentifiedInspectableItemList >
    < InspectedItem id = "i1" > <!-example of automatic detection; Temp of freezer->
    < InspectedItemDebug > <!-include only when debug mode is on->
    < name > < / name >
    < language > < / language >
    < InspectableCategory >
    < id > < / ID >
    < name > < / name >
    < / InspectableCategory >
    < / InspectedItemDebug >
    < MeasurementEvent > <!-Doesnot apply to InspectableType - 'Manual of a pick list'->
    < > 0 x 00030001 RFID < / RFID >
    < sub > 25/05/2010 13:45:01 < / sub >
    <! - value only.no units - >
    < MeasuredValue > 45 < / MeasuredValue >
    <!--
    Only for the model manual-sense, meaning automatic and manual-entry
    ->
    < / MeasurementEvent >
    < ValidationEvent id = "v4" > <! - more high-end - >
    < sub > 25/05/2010 13:45:55 < / sub >
    <!-Not < ExceptionCondition > < / ExceptionCondition >->
    < / ValidationEvent >
    < FollowUpActionEvent id = "f1" > <! - adjusted to location - >
    < FollowUpActionComments > the temp is scope now. < / FollowUpActionComments >
    < sub > 25/05/2010 13:51:45 < / sub > <!-time recorded when user click-> next
    < / FollowUpActionEvent >
    < / InspectedItem >
    < InspectedItem id = "i2" > <!-yes/no/PR Type-->
    < InspectedItemDebug >
    < name > < / name >
    < language > < / language >
    < InspectableCategory >
    < id > < / ID >
    < name > < / name >
    < / InspectableCategory >
    < / InspectedItemDebug >
    < MeasurementEvent > <!-Doesnot apply to InspectableType - 'Manual of a pick list'->
    < RFID > < / RFID >
    < UnidentifiedInspectedItemRFID > < / UnidentifiedInspectedItemRFID >
    < sub > < / sub >
    < MeasuredValue > < / MeasuredValue > <! - only for manual-sense, meaning automatic and manual-entry types - >
    < / MeasurementEvent >
    < ValidationEvent id = "v2" > <!-user selects 'No'->
    < sub > 25/05/2010 13:53:02 < / sub >
    <!-Not < ExceptionCondition > < / ExceptionCondition >->
    < / ValidationEvent >
    < FollowUpActionEvent id = "f2" >
    < FollowUpActionComments > has called the concierge team. Wait for the cleanup.
    < / FollowUpActionComments >
    < sub > 2010-05-25 14:04:43 < / sub >
    < / FollowUpActionEvent >
    < ManagerClearanceEvent >
    < ManagerRFID > 0 x 00010002 < / ManagerRFID >
    < ManagersComments > cleaning confirmed < / ManagersComments >
    < sub > 25/05/2010 14:06:39 < / sub >
    < / ManagerClearanceEvent >
    < / InspectedItem >
    < / InspectedLocation >
    < / market >
    < / WalkList >
    < HealthCheckInfo >
    < SystemStats >
    < AvailableMemory > < / AvailableMemory >
    < AvailableDiskSpace > < / AvailableDiskSpace >
    < UsedDiskSpace > < / UsedDiskSpace >
    < / SystemStats >
    < WalkDataUplaod >
    < timeStampSinceLastUpload > < / TimeStampSinceLastUpload >
    < numberOfFailedUploads > < / NumberOfFailedUploads >
    < / WalkDataUplaod >
    < storeConfigDownload >
    < timeStampSinceLastDownload > < / TimeStampSinceLastDownload >
    < numberOfFailedDownloads > < / NumberOfFailedDownloads >
    < / storeConfigDownload >
    < errors > < / errors >
    < StoreConfigXML > < / StoreConfigXML > <!-include only when debug mode is on->
    < / HealthCheckInfo >
    < / store >
    -----

    Please help me how to play this file from this column and insert into different tables. Please answer me urgently...

    Thanks in advacne.

    Sudhakar

    Hello

    Any body can help me how to do this... It is very urgent. Here is the XML file that is stored in the table as a clob column.

    There are many examples here on the forum, you may have found yourself through the search function.
    I bet that any Internet search engine could also give useful answers.

    Anyway, here's a start with your sample xml (assuming that the document is stored in the column T.DOC):

    SELECT extractvalue(x1.column_value, 'InspectedLocation/@id') as "ID",
           extractvalue(x1.column_value, 'InspectedLocation/RFID') as "RFID",
           extractvalue(x1.column_value, 'InspectedLocation/EventTimeStamp') as "TIMESTAMP",
           extractvalue(x2.column_value, 'InspectedItem/@id') as "ITEM_ID",
           extractvalue(x2.column_value, 'InspectedItem/MeasurementEvent/RFID') as "ITEM_RFID",
           extractvalue(x2.column_value, 'InspectedItem/MeasurementEvent/MeasuredValue') as "ITEM_VALUE"
    FROM t,
         table(
           xmlsequence( extract(xmltype(t.doc), 'Store/WalkList/Walk/InspectedLocation') )
         ) x1,
         table(
           xmlsequence( extract(x1.column_value, 'InspectedLocation/InspectedItem') )
         ) x2
    ;
    

    He breaks some elements of your document into columns and relational rows so that you can just insert directly into your final tables.
    Let us know if it does not meet your needs or if you have problems with some fields.

    Edit: BluShadow was faster. I'm a slow typist, however...

    Published by: odie_63 on 9 July. 2010 11:36

  • I just opened an account, I'm trying to convert a PDF document into a Word document.  Please help, I have to have this done tomorrow for my boss, or else I'll be fired.

    I'm trying to convert a PDF doc in a Word document.  I have to do before 08:30 tomorrow, Friday, July 1, 2016, otherwise I'll lose my job, someone please help.

    You bought subscription?

    You try to convert PDF using Acrobat app?

    Reference:

    Convert PDF to word, PDF to Word Converter doc | Adobe Acrobat DC

  • Please help - StdType.picture - I need this object to an activeX control!

    Hi, I use an activeX control that has a property that needs a photo.

    the problem is that it is not a path to an image.

    This is the reference StdType.picture.

    I searched the internet for answers, but could not find.

    Help, please.

    Guy.

    Problem solved!

    Just look at this Post: "How can I load an image and use it in ActiveX at the time of execution?"

  • Please help - I don't understand this: because iPad can contain only the content of five Apple ID.

    I give my son my iPad.

    I try to download Apps on it and I get the message: some of the files in the iTunes Store iTunes library were not copied to the iPad because iPad can contain only the content of five Apple ID.

    As far as I know there are only 2 Apple ID involved - my own and the one we did for him as a minor.

    If someone has had this problem and can you help me to overcome.

    It is typical that this situation happens the day before her birthday - I wanted to give him tomorrow all loaded with his own stuff. It five of its apps accepted last month when I first came with the idea and now...

    Anyone?

    This means what it means: iTunes Store items are tagged with the Apple that was used to buy ID. Apparently in this case, for some reason, over 5 ID are involved. Which could include accounts that are no longer used.

    In general, it is best to follow these steps before giving your iPad to someone else: what to do before you sell or give away your iPhone, iPad or iPod touch - Apple Support

  • I have an XML file to a TV schedule that I would like to put on their website of Muse. Please help how I can do this.

    The link to the XML of the annex is lower.

    http://vertrotv.hostedbroadcasting.com/XML/program_schedule_feed?channel_id=1

    This link is how it appears on their site that they receive from the program.

    Annex

    Hi Patrick,

    Please refer to: is it possible to import xml into Adobe Muse to fill similar to InDesign content?

    Kind regards

    Akshay

  • Please help get the logic for this

    Hello Frs,

    I need like if a number is a whole number divide by 100, otherwise if we number integer (for ex 500.23) then leave it as it is how to write a logic to find out if a number is integer or not?

    I need to write a function similar to the following

    Begin
    If invoice_amount = 500 (integer)
    then a = invoice_amount/100;
    on the other
    a = invoice_amount;
    end if;
    return a;
    end;

    If anyone has idea pls help


    Thank you
    Marilou

    Hello

    You can do this in SQL by using the CASE statement.
    For example:

    SELECT  CASE            WHEN  invoice_amount = TRUNC (invoice_amount)            THEN  invloce_amount / 100            ELSE  invoice_amount        END     AS a...
    
  • The bottom of the window has this thick grey bar, almost a thick band... He has no response to mouse clicks, etc. and I can't get rid of it; It remains lit even in mode full screen. Please help me get rid of this...

    Here is a picture of the show to help you see the problem easily.

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).

  • I do not have a disk for my computer and want to restart is back to the way I bought, please help how can I do this

    Hello

    my partner has a computer laptop bieng a complete spaz when buying said computer laptop did not come with a disk or a backup appeared basically does anyone know how I reboot back to when my partner bought so we can start all over again
    laptop is a Toshiba satellite operating system windows vista Home premium

    Hello

    With a Toshiba, if you do not have to purchase recovery disc, there will be a disk to reinstall Vista from recovery Partition.

    You press 0 (zero) to the starting power / and follow the instructions of Toshiba to reinstall back to the factory settings.

    There are several methods to reinstall Vista, you may be interested.

    There is no Windows Vista downloads available from Microsoft.

    You can contact your computer manufacturer and ask them to send you a set of recovery disks.

    They should do this for a small fee.

    To reinstall Vista using their recovery disk/s, you start from the 1st recovery disk they provide and follow the manufacturer's instructions to reinstall:

    You need to change the Boot order to make the DVD/CD drive 1st in the boot order:

    How to change the Boot order in BIOS:

    http://pcsupport.about.com/od/fixtheproblem/SS/bootorderchange.htm

    "How to replace Microsoft software or hardware, order service packs and replace product manuals.

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

    And if you have never received a recovery disk when you bought your computer, there should be a recovery Partition on the hard drive to reinstall Vista on how you purchased your computer.

    The recovery process can be started by pressing a particular combination of the key or keys at startup. (Power on / start)

    Maybe it's F10, F11, Alt + F10, etc., depending on the manufacturer.

    Ask them to the proper key sequence.

    And if you do not score a manufacturer of recovery on your hard drive, you should be able to make your own recovery from her disks to reinstall the operating system.

    Go to programs > name of the manufacturer of your computer > then their system or recovery tools software topics for them, depending on how it is formulated.

    If you can't find any reference to it, contact the manufacturer for advice on how to make these recovery disks.

    Some manufacturers have more available Vista recovery disks.

    If this happens, you may need to try this instead:

    You can also borrow and use a Microsoft Vista DVD, which contains the files for the different editions of Vista (Home Basic, Home Premium, Business and Ultimate) must be installed. The product key on your computer / Laptop box determines what Edition is installed.

    Other manufacturers recovery DVDs are should not be used for this purpose.

    And you need to know the version of 'bit' for Vista, as 32-bit and 64-bit editions come on different DVDs

    Here's how to do a clean install of Vista using a DVD of Vista from Microsoft:

    "How to do a clean install and configure with a full Version of Vista '

    http://www.Vistax64.com/tutorials/117366-clean-install-full-version-Vista.html

    And once the operating system is installed, go to your computer manufacturer's website and get the latest drivers for your particular model or laptop computer.

    And phone Activation may be necessary when you use the above installation method.

    "How to activate Vista normally and by Activation of the phone '

    http://www.Vistax64.com/tutorials/84488-activate-Vista-phone.html

    See you soon.

  • I get an error on RMAN, please help, I'm new on this

    I get the error message

    RMAN-03009: faliure of backup command on 13/02/14 channel ORA_DISK_1

    ORA-19504: cannot create the file '\APP\AHMED\FLASH_RECOVERY_AREA\TESTDB\BACKUPS '.

    ORA-27038: created file already exits

    OSD-04010: < create > option specified, folder already outputs

    I think your problem is that the file that you tried to create already exists ("\APP\AHMED\FLASH_RECOVERY_AREA\TESTDB\BACKUPS\")

    so more commands to do this, before taking a full backup of database

    Configure the format of disc type peripheral canal "\APP\AHMED\FLASH_RECOVERY_AREA\TESTDB\BACKUPS\backup_%U.bkf";

    -% you will be replaced by unique file names

    or

    Configure the format of disc type peripheral canal "\APP\AHMED\FLASH_RECOVERY_AREA\TESTDB\BACKUPS\backup_%t_s%s_s%p";

    The %t format specifier is replaced with a timestamp of four bytes and %s with the defined number of backup %p with the number of the backup piece.

    Ref:

    ORA-27038 errors during the backup, RMAN: ORA-19504 when a Backupset is in Place (Doc ID 1082911.6)

    Thank you

    Renu

  • Please give me the answer to this query

    Hi all

    Select to_char (123.5, 'fm$ 99999.00') of double

    When I run it I get a result of $123,50

    I want to use other characters like speacial @, * instead of $

    But I am getting error invalid identifier if I use any other speacial character that $

    Can I use? otherwise what would be the reason

    appreciate for the quick reply

    Thanks in advance

    as?

    select replace(to_char(123.5,'fm$99999.00'),'$','@') from dual
    
    @123.50
    
  • Please help me with this vi

    Hello friends I m new learner

    Please help me

    I have this program Please tell me how to send readings and data in table vi and wwhen I press the button log file it should save the file one by one? and

    Please tell me the logic also when I press next, he must go to the next page and back then return to the page and pressing out he must go out and finally next page button should disappear...

    someone help me please

    Thanks in advance

    concerning

    Naomie

    Please use complete words when entering posts on the forum and not 'text speak '.  A plea for words full

    A problem I see is that you have lots of tunnels in the structure of your case where you do not connect the data in all cases.  You end up with the tunnels for "Use default if unwired", feeding the default data in your shift register which later get used.  Probably not what you want.

  • Please help me solve this BSOD ntoskrnl.exe, ntkrnlmp.exe

    Hello

    I have problems with my new computer since I bought it, it started giving problems. Now this BSOD. I am totally frustrated with it. Please help me get rid of this questions.
    Here is the link of the minidump file:
    https://SkyDrive.live.com/redir?RESID=1F218460C89B0917%21114
    I guess that the culprit is wireless driver. With the old version of the wireless driver, I got another BSOD, so I uninstalled and installed the most recent version. Still problem persists.
    With whoCrashed, I found this information:
    Windows version: Windows 7 Service Pack 1, 6.1, build: 7601
    Windows dir: C:\Windows
    CPU: GenuineIntel Intel (r) Core i7-3610QM CPU @ 2.30 GHz Intel586, level: 6
    8 logical processors, active mask: 255
    RAM: 8469991424 total
    VM: 2147352576, free: 1902690304

    Crash Dump Analysis
    Crash dump directory: C:\Windows\Minidump

    Dumps are enabled on your computer.

    Tuesday, December 23, 13 9:36:04 CEST your computer crashed
    crash dump file: C:\Windows\Minidump\122313-27736-01.dmp
    This was probably caused by the following module: ntoskrnl.exe (nt + 0 x 72680)
    Bugcheck code: 0x9F (0x3, 0xFFFFFA8007539060, 0xFFFFF80000B9C3D8, 0xFFFFFA800FE606B0)
    Error: DRIVER_POWER_STATE_FAILURE
    file path: C:\Windows\system32\ntoskrnl.exe
    product: Microsoft® Windows® Operating System
    company: Microsoft Corporation
    Description: NT Kernel System &
    Bug control description: this bug check indicates that the driver is in an inconsistent or invalid power state.
    This seems to be a typical software driver bug and is not likely to be caused by a hardware problem.
    The accident took place in the Windows kernel. Maybe this problem is caused by another driver who cannot be identified at this time.

    Tuesday, December 23, 13 9:36:04 CEST your computer crashed
    crash dump file: C:\Windows\memory.dmp
    This was probably caused by the following module: ntkrnlmp.exe (nt! KeBugCheckEx + 0x0)
    Bugcheck code: 0x9F (0x3, 0xFFFFFA8007539060, 0xFFFFF80000B9C3D8, 0xFFFFFA800FE606B0)
    Error: DRIVER_POWER_STATE_FAILURE
    Bug control description: this bug check indicates that the driver is in an inconsistent or invalid power state.
    This seems to be a typical software driver bug and is not likely to be caused by a hardware problem.
    The accident took place in the Windows kernel. Maybe this problem is caused by another driver who cannot be identified at this time.

    Please help me. Thanks in advance.

    Apvmz

    This phenomenon was related to the device driver wireless Extensible athrx.sys of Atheros Communications, Inc.  Yours is almost 2 years so not the most recent.

    I would like to re - install the latest driver available

Maybe you are looking for

  • Satellite M100 Track Pad failure

    I recently performed a 'factory restore' on a Satellite M100 (with Vista Home Basic Edition). It was hoped that this process would solve one issue was the recent failure of the functionality of the "pad".It doesn't happen if the problem persists. The

  • MacBook pro compatible with Thunderbolt display

    Hi guys,. I'm Thunderbolt Display 27 inches. but I am not able to connect with the non Apple laptop. So I'll buy the Macbook pro 13 inch, but I'm confused. Please see product here http://www.amazon.in/gp/product/B00DKMCB20?keywords=macbook%20pro & qi

  • Zoo Tycoon 2 - cannot run

    My daughter has Zoo Tycoon 2 Ultimate Collection. It runs on a 32-bit computer Win 7 with 3 GB of RAM. It worked very well for a long time. After a few months of not playing, she inserted the CD and launched the program. The screen 'Run', 'Install',

  • ASUS X53S i7 PC PORTABLE hard drive: WD My Book essential HD material

    PC PORTABLE ASUS X53S i7 Hard drive: WD My Book essential HD material NN mi riconosce più HD WD Exsential... mi potete cone disastrous rates ad avere di nuovo it controllo bus...? Grazie

  • Acer Aspire model M5 - 581T. Bought with Windows 8. Updated to 8.1. BIOS is UEFI?

    I have this model and the OS. Trouble with the battery "not detected" but if I turn on with battery AC shows OK and charge, thereafter. Draft AC translates power off like battery not here, but not immediately. May issue of BIOS? Maybe the pilot? How