SQL query help in oracle database 11g

I have test table name these data and column as

Select t.user_id, t.user_date, t.amount

t-test

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

User_id date amount

10 1/1 / 2011 10

20/1 2/11/2011

11 1/3 / 2011 30

40/2 10/2/2011

You want to display data in this format...

User_id date amount here is the logic how to get the amount

1                  10/1/2011      10                      10

11 1/2 / 2011 30 10 + 20

11 1/3 / 2011 60 (10 + 20) + 30

2                   10/2/2011      40                         40

SELECT t.user_id, t.user_date, t.amount
, SUM (t.amount) OVER (PARTITION BY t.user_id
                           ORDER BY t.user_date
                         ) AS the amount
Of t-test
ORDER BY t.user_id
, t.user_date
;

Tags: Database

Similar Questions

  • 1Z0-054: Oracle Database 11g Performance Tuning Expert

    I intend to give the exam 1z0-054 for the certification, "Oracle Database 11g Performance Tuning Expert".

    The path to Certification indicates that, if you are 'OCP DBA 11 g' then you can directly take this article and there is no requirement for training instructor. Therefore, I decided to prepare my own. Can someone guide me on study material and landfills?

    Kind regards

    Ahmer Mansoor

    Therefore, I decided to prepare my own. Can someone guide me on study material and landfills?

    First of all, the word "shock" has a precise meaning. It is short for "landfills of brain", which are illegal and can cost you this certification and all others you have taken.

    http://blogs.Oracle.com/certification/entry/0477

    Second - there is currently no study guide or a specific book to this certification at the moment. I write the study guides and this one is actually next on my list when I finished the current book to * 1Z0-117: Oracle Database 11 g Release 2: SQL Tuning *. I have a guide for 1Z0 - 054 before sometime in may more likely. That said, I have a few links for legal study on the companion Web site material for my series of guide to the subjects for this exam. It also has links to the Oracle documentation that contains the information you need. Once I have started writing the book review, links will develop quickly because I research for her themes and links to the documentation could extend as well.

    http://www.oraclecertificationprep.com/Apex/f?p=OCPSG:EXAM_DETAILS:0:no:P2_EXAM:1Z0 - 054

  • Upgrade to the 10.2.0.4 release without Oracle Database 11g

    Hi everyone, I need to upgrade the OWB Production current client version:

    Client version: 10.2.0.1.31
    Version of the repository: 10.2.0.1.0
    Database version: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64 bit Production

    to the 10.2.0.4 release, using the patch # 7005587 (uploaded on Metalink)

    I have red as the Patch Readme and I found that it is necessary to migrate to Oracle Database 11g.
    Now my question is this: can I apply the patch above WITHOUT upgrading the database?
    The customer asked me if it is possible to continue to use the 10 g Enterprise Edition Release 10.2.0.5.0 and upgrade OWB to the 10.2.0.4 release... Is this possible?

    Thanks in advance for your help

    Alex

    Hello

    In my view, there is some lack of communication happening. 10.2.0.4 OWB can be used with Oracle 10.2.0.5.
    We even had OWB 10.2.0.5 running against Oracle 10.2.0.5

    According to me, that there are some bad this info in the patch readme file. OWB 10.2.0.4 includes support for Oracle database 11g (as a Source). This is a major change incorporated in this version.

    Thank you
    Fati

  • Configure Enterprise Manager in Oracle Database 11g

    Dear all,

    I want to configure my Enterprise Manager Console for Oracle Database 11g. During installation I unchecked "configure EM Console."

    I have Oracle Red Hat Linux 6.5, please guide me how can I start my console em on the Linux environment.

    Kind regards

    Atif Zafar

    Hello

    If you want to create or configure Enterprise Manager console, follow these steps:

    • Set ORACLE_HOME environment variable
    • Set ORACLE_SID
    • ORACLE_HOSTNAME environment variable set. Use the same value returned by the command "hostname".
    • Run the emca (Enterprise Manager Configuration Assistant).

    $ emca - create config dbcontrol db-rest

    • Follow the instructions.

    Kind regards.

  • can I use "Oracle Database 12 c: performance management and Tuning" training for the certification "Oracle Database 11g: Performance Tuning 1Z0-054 '"»

    I took "Oracle Database 12 c: new performance management and Tuning" the oracle University training. Now I would like to get certified on "Oracle Database 11g: Performance Tuning 1Z0-054 ' exam. Is this possible?

    I guess you ask if you can use the course 12 c as long as the condition of course for the review of 11g.  Over 12 c is not listed as one of the options for the 11 g certification and course requirements are normally specific version - at least with DBA certifications.  If you are already an Oracle OCP DBA, of course, there is no requirement of course for the review of performance tuning.  From what I know the training requirements for other certifications, I do not that you will be able to use it. However, Brandye will provide a definitive answer to whether the course 12 c would be acceptable for 11g certification.

    That said, I'm with John - 12 c review is about a community of 85 to 90% in the review of the 11g and is currently about 20% of the price while it is in beta.  What is the point of trying to cross the releases?

  • Oracle Database 11g R2 under Oracle Linux

    Hi, I am very new to the oracle dba. I tried to install oracle database 11g r2 on Oracle Linux 64-bit. What version of oracle linux best costumes?
    Thanks for your reply.

    857367 wrote:
    Hi, I am very new to the oracle dba. I tried to install oracle database 11g r2 on Oracle Linux 64-bit. What version of oracle linux best costumes?
    Thanks for your reply.

    http://www.Oracle.com/us/technologies/Linux/index.html

  • Move to Oracle Database 11g Release 2 with Mike Dietrich

    Hi friend;

    Yesterday, I was in an Oracle in Istanbul.

    In the seminar; Author Mike Dietrich, who works in Germany-Oracle show us how to do the step of database Oracle 11 g Release 2. His presentation available on my blog.

    I highly suggest to check this pdf. It already has cover:

    -Support of politicians, patches, Documentation, upgrade paths
    -Database upgrade (DBUA, command line, after the upgrade, alternatives, Clusterware and ASM upgrade)
    -Diagnosis and Tuning
    -Performance evaluation

    You can find many useful tips, path of evolution, related notes metalink etc etc... in the pdf file.

    http://heliosguneserol.WordPress.com/2010/06/17/move-to-Oracle-database-11g-release-2-with-Mike-Dietrich/

    Respect of
    HELIOS

    Helios,

    Interesting paper! Thanks for sharing with us.

    Thank you
    Hussein

  • The CPU is not powerful enough for Oracle database 11g?

    The CPU is not powerful enough for Oracle database 11g?

    I installed the datatase Oracle 11 g on my host by using the default configuration of oracle yesterday. Today, I find some the alert message: "CPU usage is 86,79%, through attention (80) or critical (95) threshold.» The average value of the CPU usage is 80.85% and I have to wait for more than 10 seconds for opening a page of the EM.
    My host is HP workstation xw4200. CPU is 3.4 GHz. No other applications on that host.
    I want to know: what is the main reason for the shortage of CPU resources? Because the database Oracle 11g itself is exhausting CPU or because there are a few configuration issues?

    qkc wrote:
    1 is it true that most of the CPU is exhausted by the EM control tool?

    It's quite possible.

    It is also one of the reasons why we encourage people to drop EM Database Console and switch to EM Grid Control. The burden is then on another server.

    2. why this index has been added in advance by Oracle Corporation? It does not seem that each tool is set up perfectly in advance.

    It was probably not required under ideal conditions, in which it has been designed and tested.

    Why is your environment not identical to the designed conditions that use Oracle? ;-)

  • where can I get the software for oracle database 11g RAC installion

    pls can someone tell me where to download the installation software for oracle database 11g RAC with Yes which has the option of installing RAC database on, I the installation of database 11g software, but it does not include the installation of database RAC inside option, I heard someone say that the installer of oracle database 11g in oracle's Web site is not used to install a RAC database is it true? If that's how to make one that installs the RAC DATABASE.

    Download page:
    http://www.Oracle.com/technology/software/products/database/Oracle11g/111060_linuxsoft.html

    -Oracle Database 11 g Release 1 (11.1.0.6.0) for Linux x 86
    linux_11gR1_database_1013.zip (1,844,527,800 bytes) (cksum - 1044354138)

    -Oracle Clusterware 11 g Release 1 (11.1.0.6.0) for Linux x 86
    linux_x86_11gR1_clusterware.zip (244,660,141 bytes) (cksum - 820583335)

    Maybe you need to download is: Clusterware Oracle 11 g

    Document: Oracle® database 2 day + Real Application Clusters guide 11 g Release 1 (11.1)
    http://download.Oracle.com/docs/CD/B28359_01/RAC.111/b28252/TOC.htm

  • Execution of the SQL query through 2 different databases to Oracle

    Hi all

    In Microsoft SQL server, we can run on 2 different databases depending on the type of SQL query:

    Select * from TEST1.dbo.GENERIC_TABLE1 union select * from TEST2.dbo.GENERIC_TABLE2;

    Test1 and TEST2 here is 2 different databases.

    Can we do the same in Oracle?

    Of course you can do it.
    Create a [database join | http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_5005.htm] from DB1 to DB2.

    Grant select on the tables of the DB2 schema with which you want to connect.

    And then, you can you can query as

    select * from DB1schema.emp
    union
    select * from emp@dblink_name;
    
  • NoSuchMethodError setStringAtName in Oracle Database 11g Release 2

    Hi, I'm using Oracle Database 11 g Release 2 on Windows 7 Ultimate 32 bit.

    I use Oracle SQL Developer 4.1.0.

    In SQL Developer, the connection is established and is successfully tested, but when I click on connect, I get the error:

    java.lang.NoSuchMethodError: oracle.jdbc.OracleCallableStatement.setStringAtName (Ljava/lang/String; Ljava/lang/String ;) V


    The complete exception message:


    java.lang.NoSuchMethodError: oracle.jdbc.OracleCallableStatement.setStringAtName (Ljava/lang/String; Ljava/lang/String ;) V to oracle.dbtools.db.OracleUtil.checkAccess(OracleUtil.java:400) to oracle.dbtools.db.DBUtil.hasAccess(DBUtil.java:1887) to oracle.dbtools.raptor.query.QueryUtils.checkNonOracleAccess(QueryUtils.java:589) to oracle.dbtools.raptor.query.QueryUtils.getQuery(QueryUtils.java:399) to oracle.dbtools.raptor.query.QueryUtils.getQuery(QueryUtils.java:250) to oracle.dbtools.raptor.query.ObjectQueries.getQuery(ObjectQueries.java:43) to oracle.dbtools.raptor.navigator.db.xml.XmlObjectFactory.createFolderInstance(XmlObjectFactory.java:60) to oracle.dbtools.raptor.navigator.db.xml.XmlTypeOwnerInstance.listTypeFolders(XmlTypeOwnerInstance.java:93) to oracle.dbtools.raptor.navigator.db.impl.TypeContainerTreeNode.loadTypeFolders(TypeContainerTreeNode.java:111) to oracle.dbtools.raptor.navigator.db.impl.DatabaseTreeNode$ LoadTask.doWork (DatabaseTreeNode.java:183) to oracle.dbtools.raptor.navigator.db.impl.DatabaseTreeNode$ (DatabaseTreeNode.java:112) LoadTask.doWork to oracle.dbtools.raptor.backgroundTask.RaptorTask.call(RaptorTask.java:193) to java.util.concurrent.FutureTask.run(FutureTask.java:266) to oracle.dbtools.raptor.backgroundTask.RaptorTaskManager$ (RaptorTaskManager.java:621) RaptorFutureTask.run to java.util.concurrent.Executors$ (Executors.java:511) RunnableAdapter.call to java.util.concurrent.FutureTask.run(FutureTask.java:266) to java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) to java.util.concurrent.ThreadPoolExecutor$ Worker.run (ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)


    Yesterday I could connect fine, but today I got this error.

    How can I solve this? Thank you...

    Developer SQL resides on the same system as Oracle DB.

    What has changed is that I placed the files ojdbc6.jar and ojdbc14.jar is in F:\Program Files\Java\jdk1.8.0_45\jre\lib\ext and F:\Program Files\Java\jre1.8.0_45\lib\ext because I work with a Web site of jsp that access the oracle database.

    The problem is that ojdbc14.jar is is for Oracle Database 10g Release 2 and I work with is 11g, so I left the ojdbc6.jar in both paths and now Developer SQL works, thank you very much!

  • Oracle Database 11g XE and OraClient10g_home1?

    Hello

    I want to install Oracle database 11 g Express Edition on a Windows 7 System of teacher.

    However, it is already le OraClient10g_home1 pilot installed.

    Can be both Versions of Oracle IParry?

    Or must be OraClient10g_home1 driver uninstalled front?

    Thank you for all

    Hello

    It is possible to have more than one Oracle home (several versions in your case 10g and 11g) in one machine.

    Therefore:

    May be two versions of Oracle installed?

    Yes.

    Or must be OraClient10g_home1driver uninstalledbefore?

    Laughing out loud

    I hope this helps.

    Best regards

  • I am now "Oracle Database 11g Administrator Certified Associate"

    Hello

    After very hard work I am now Oracle Database 11 g Administrator Certified Associate. I attended courses (I have Admin and SQL Fundamentals) 3 years ago. My knowledge of Oracle is only the OCA 11 g scope and have no knowledge of Java.

    What should I do next?

    -1Z0-047 Oracle database SQL Expert certified

    or

    -1Z0-803 Java SE 7 programmer I have

    What could be more simple?

    I'm looking for an easy victory

    I'm not a big proponent of "easy". I'm much more a fan of "useful". It is not easy to determine what is 'easy' for you. It is quite difficult to find which is easy for me. That said, a basic rule of quick and dirty to compare Oracle certifications is:

    Easier
    OCA - wide range of subjects - shallow
    OIS - narrow range of topics - moderate depth (implementation specialist - don't know if they really have an accepted acronym)
    OCP - wide range of subjects - moderate depth
    OCÉ - narrow range of topics - deep
    COM - Together different ball game - perform or fail
    More difficult

    Because you ask about a SANDBOX test vs a review of ECO, the basic response is going to be that the review of the OCA is easier. Which does not account for you. As far I know, you might be allergic to Java mentally, and maybe that's the thing the more difficult learning you already have.

  • Impossible to install oracle database 11g r2 under linux guest system

    Hi all

    I have a fedora 18 comments system installed in windows home 7 using virtualbox. I am installing the oracle 11.2.0.2 database in my comment fedoral system. The oracle database is on a shared folder. I tried these two commands to install the database:

    [root@localhost database] # chmod + x./install/.oui
    [root@localhost database] #. / runInstaller
    . / runInstaller: line 254: /media/sf_MyShare/Oracle/database/install/.oui: cannot execute binary file
    However, he failed miserably. I don't have any experience in the installation of oracle on linux database. Can anyboday give me a clue to help me solve this problem? Thank you very much in advance.

    Hong

    As I said

    For the error cannot execute binary file, check if you have downloaded the right version of the database for your architecture.

    ZLinux is port of LInux to the IBM servers, it is a bad download corresponding to your installation. ;)

  • Hyperion 11.1.2.2 of Oracle Database 11g installation

    Hi all

    We plan to install hyperion 11.1.2.2(64-bit) with 11 g (64-bit) of the Oracle database in windows server 2008 R2(64-bit)
    We must right customer Oracle 64-bit and 32-bit. ! (for FDM, such as recommended in the installation documentation)

    If so, we install all products in one machine. What client (32 or 64-bit), it must first install?

    Is it necessary to install also the ODAC?
    If so, that is we must install 64-bit or 32-bit?

    any help would be appreciated.

    Kind regards
    Mady

    Hi Mady,

    We do not have everthing on a box, but also use all 64 bits.
    Client Oracle is 11.2.0.3

    I checked
    Oracle JDBC/THIN Interface
    Oracle Call Interface
    Net Oracle
    ODBC Oracle driver
    Objects for OLE Oracle
    Oracle OLE DB provider
    Oracle Data Provider for .NET
    Oracle for ASP.NET providers

    Be sure to install the 32-bit version first, then 64-bit on top.

    I hope this helps.
    Roman

Maybe you are looking for