How to apply the horizonal rule in SQL Statement

My Problem is...
Have One table called: T1
Fields are...
TC Varchar2(10),
c1 Number,
c2 Number,
Dt Date Columns.
Now The Records are...
Record 1: 'Tc101',1,1,Day3
Record 2: 'Tc101',2,2,Day2
Record 3: 'Tc101',3,3,Day1
Record 4: 'Tc101',1,1,Day3
Record 5: 'Tc101',2,2,Day2
Record 6: 'Tc101',3,3,Day1
Record 1: 'Tc102',1,1,Day3
Record 2: 'Tc102',2,2,Day2
Record 3: 'Tc102',3,3,Day1
Record 4: 'Tc102',1,1,Day3
Record 5: 'Tc102',2,2,Day2
Record 6: 'Tc102',3,3,Day1
Now, I want to display...
TC Day1 Day2 Day3
'TC101', 2,2, 4,4, 6,6
'TC102', 2,2, 4,4, 6,6
If i am adding new records for TC101 Then I Wnat to display...
Record 1: 'Tc101',1,1,Day4
Record 2: 'Tc101',2,2,Day4
Record 3: 'Tc101',3,3,Day4
Now, I want to display...
TC Day1 Day2 Day3 Day4
'TC101', 2,2, 4,4, 6,6 6,6
'TC102', 2,2, 4,4, 6,6
If i am adding new records for TC102 Then...
Record 1: 'Tc101',1,1,Day5
Record 2: 'Tc101',2,2,Day5
Record 3: 'Tc101',3,3,Day5
Now, I want to display...
TC Day1 Day2 Day3 Day4 Day5
'TC101', 2,2, 4,4, 6,6 6,6 0,0
'TC102', 2,2, 4,4, 6,6 0,0 6,6
If i am adding new records for TC103 Then...
Record 1: 'Tc103',1,1,Day5
Record 2: 'Tc103',2,2,Day5
Record 3: 'Tc103',3,3,Day5
Now, I want to display...
TC Day1 Day2 Day3 Day4 Day5
'TC101', 2,2, 4,4, 6,6 6,6 0,0
'TC102', 2,2, 4,4, 6,6 0,0 6,6
'TC103', 6,6
Here, I want to display Maximun 1 Week(7 Days only)
kindly, provide the Solution for this Senario ASAP.

Hello,
U need this in report or in sql mode

Similar Messages

  • How to export the result from executing sql statement to excel file ?

    HI all,
    Great with Oracle SQL Developer, but I have have a trouble as follwing :
    I want to export the result from executing sql statement to excel file . I do easily like that in TOAD ,
    anyone can help me to do that ? Thanks so much
    Sigmasvn

    Hello Sue,
    I just tried to export to excel with the esdev extension and got java.lang.NumberFormatException. I found the workaround at Re: Windows Multi-language env, - how do I set English for application lang?
    open the file sqldeveloper\jdev\bin\sqldeveloper.conf and add the following two lines:
    AddVMOption -Duser.language=en
    AddVMOption -Duser.country=USyet now my date formats in excel are 'american-style' instead of german. For example 01-DEC-01 so excel does not recognize it as date and therefore I can not simply change the format.
    When export to excel will be native to 1.1 perhaps someone can have a look at this 'feature'
    Regards
    Marcus

  • How to control the rounding rule at answer?

    Hi grus,
    I use the BIEE 11.1.1.6.5.
    And I create the 2 answers(A and B) with a same column which setting is same column formula and data format(Treat Numbers As "number", Decimal places "2") on column properties.
    Then I run the answer A that the value is 3.68( this column's SQL value is 3.675, so this means rounding up the value)
    But I run the answer B with same criteria that the value is 3.67(this means truncating the value)
    Why do these difference happen?
    How to control the rounding rule?
    Best Regards,
    Takashi

    Hi,
                 When add the Itemcode, default warehouse and costing codes (Profit Center) are automatically asign by SAP.
    When change the warehouse for this Itemcode, the costing codes(Profit Center) are disappear. I don't want to disappear the costing codes, that's why I try to resign the default costing codes when the warehouse change.
                At SAP 2005, easily  access the screen matrix in the marketing document and add the required values in each costing codes columns. But SAP 2007, all costing codes are combined in 1 col and those have the other screen.
              Do you have any idea to control the costing codes?
    Thanks and regards,
    Lei Nandar Myint

  • How to apply the Patchset 7 to Forms 6i

    Hi all !!!
    I need install the PatchSet 7 in the iAS Server 1.0.2.2.2 (concrectly at the Forms Server Service).
    I had stopped all services of Oracle, and had applied the patch. But the services of Forms and Reports is missing after.
    Any idea.
    How to appplies the patch?
    Thanks and best regards.
    Carlos Hernandez
    Barcelona (Spain)

    848478 wrote:
    How to apply the latest patch set for all the Installed Modules in 11.5.10.2 along with the Roll up's if any.https://forums.oracle.com/forums/search.jspa?threadID=&q=Latest+AND+Patchsets&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Latest+AND+Patches&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Same shooting, multiple lenses, how to apply the appropriate lens correction when importing ?

    Hello everyone,
    How do you handle this:
    For each camera, i have a default preset i'm choosing manualy and applying when importing my raw files into lightroom.
    I'd like to also add some default lens correction to those presets.
    The problem is that multiples lenses (meaning different corrections) may be applied.
    How to apply the correct lens correction for each file, in the batch import ?
    Thanks for your ideas ...
    Aymeric

    Update your existing develop presets so that the Lens Corrections are checked (see attached screen shot). Select the develop preset in Import dialog. Lr will automatically apply the appropriate default lens profile to each individual image during import.

  • How to change the SERVICE_NAME in PL/SQL

    The service_name in PL/SQL Developer is PLSExtProc,but my database's ture name is ORCL.How to change the service_name in PL/SQL Developer?

    I am not sure about how to change SERVICE_NAME in PL/SQL Developer (if at all it can be done in that ), but you will have to change the SERVICE_NAME in the TNSNAMES.ORA file.
    1. Locate the entry for PLSExtProc in the file tnsnames.ora at:
    $ORACLE_HOME/network/admin/tnsnames.ora
    2. Change the SERVICE_NAME = ORCL
    3. Save and reconnect
    Aalap Sharma :)

  • How to restore the Password backup in sql server 2005

    How to restore the Password backup in sql server 2005

    Hello,
    THANKS............ BUT
    I executed this query 
    RESTORE DATABASE new_data1
    FROM DISK = 'd:\UK_DETAILS.bak'
    with password ='selfinity123'
    WITH MOVE 'UK_DETAILS.bak' TO 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\new_data1.mdf',
    MOVE 'UK_DETAILS.bak' TO 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\new_data1.ldf'
    I got the error 
    Msg 319, Level 15, State 1, Line 4
    Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon.

  • How to set the connection parameters for SQL

    How to set the connection parameters for SQL to access the MS Access database
    Attachments:
    Quick_SQL.vi ‏21 KB
    Doc1.doc ‏45 KB
    db1.mdb ‏112 KB

    Right-click the WINDOWS desktop, choose New->Microsoft Data Link. That will bring up a dialog that allows you to configure and test your database connection. You might connect to the Access database via ODBC or directly via Jet Engine. The Jet Enginge saves you the trouble of creating an ODBC connection on your PC. After you leave the dialog, the "data link" will show up on your desktop as text file. Open it and copy-paste the connection string to your VI.
    This webpage is an excellent resource for connection strings: http://www.able-consulting.com/ADO_Conn.htm
    If your application requires users to change the database connection at runtime, you can also include the dialog via ActiveX (MSDASC.IDataSourceLocator).

  • How to define the copy rules in master contract

    Hi,
    Could you please help me on how to define the copy rule in master contract . I cann't find the link,it's not under IMG/SD/sales/contract/master contract/define referencing prodecures.
    Thanks/Cindy

    Hi Sai,
    I'm afraid VTAA may not resolve my problem. What I want is to define the copy rule. When you go into IMG/SD/sales/contracts/master contract/define referencing requirments/define reference procedure    you will find there is a copy rule in field area. What I really want is to define that copy rule.
    Thanks

  • How to deactivate the Transfer rules

    Hi
    While i was activating the cube by using the options " In data flow before" all the tranfer rules and the update rules have been activated,,,,,,,,,,,,,,,,now i want to create the transformations on that cube for that I just want to know how to Deactivate the transfer rules and the Update Rules..............so that in future if i require them i can use them later..........

    hi preethi,
    carry on with your transformation.
    unless u create infopackage for 3.x infosource u will not encounter update & transfer rules.
    KEEP IN memory once u use a data source r/3-bw(u activate it in rsa5 in r/3 side& use it intransfer rules datasource definition).
    u will not be able to assign the same datasource another time.
    this is not the case with flat file loads were u assigh it as pcfile or my file .
    reward points if helpful

  • How to describe placeholder/parameters in a SQL statement

    Hi
    Does anybody know how to describe the placeholder/parameters in a statement? I only find the OCI documentation talking about "Describing Select-list Items". But what if I want to retrieve the data type of a placeholder (assuming I don't know beforehand or just want the program to be more flexible)? Doing this by describing schema metadata first (have to find out which schema object to use) and then using OCIDescribeAny() seems not a very good way. Thanks.

    Jonah, and others,
    how would you find out the (hash_value, address) of the statement just described to extract the statement-relevant information from V$SQL_BIND_CAPTURE?
    Via a join with V$SQL and the statement's text?
    Thanks, --DD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to enter bind variables in Calender SQL statement

    Hi,
    Anyone know how to include bind variables in Calender SQL statement. Let's say in sql statement below:
    select
    EMP.HIREDATE the_date,
    EMP.ENAME the_name,
    null the_name_link,
    null the_date_link,
    null the_target
    from SCOTT.EMP
    order by EMP.HIREDATE
    thanks.

    Hi,
    Here is the sql statement
    select
    EMP.HIREDATE the_date,
    EMP.ENAME the_name,
    null the_name_link,
    null the_date_link,
    null the_target
    from SCOTT.EMP
    where deptno = :dept
    order by EMP.HIREDATE
    Thanks,
    Sharmila

  • Can the format of a SQL Statement modify the execution time of an SQL ....

    Can the format of a SQL Statement modify the execution time of an SQL statement?
    Thanks in advance

    It depends on:
    1) What oracle version are you using
    2) What do you mean for "format"
    For example: if you're on Oracle9i and changing format means changing the order of the tables in the FROM clause and you're using Rule Based Optimizer then the execution plan and the execution time can be very different...
    Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2009/12/29/estrarre-i-dati-in-formato-xml-da-sql/]

  • Check the validity of a SQL statement before execution

    Hi everyone,
    In an applet I have created, I am allowing the user to create a SQL statement which will be sent to a servlet that in turn issues the JDBC request for the SQL statement. My concern is that since my GUI lets the user create more or less any kind of SQL statement (including an illegal one) I need to verify if the user has created the correct SQL. How can this be achieved?
    To recapitulate and summarize, I need to know how I can check the validity of a SQL statement without actually executing it and handling the SQLException. FYI, I am using the mm-mysql driver.
    Thanks,
    Alan

    jschell is correct. Unless you're writing something like an ISQL tool you want to be very careful doing this.
    Having said that Mimer SQL have SQL validators that may do what you want http://developer.mimer.com/validator/index.htm
    They've also got the SQL Validator running as a web service that you can use. Theres example code here showing how to use it.
    http://sqlvalidator.mimer.com/index.html
    At the risk of being accused of selfpromotion you can check out the SQL Validator plugin for SQuirreL SQL CLient. This is a fully functional example of using the Mimer SQL Validation web service. http://squirrel-sql.sourceforge.net/
    Col

  • How to compile the hint to force selection statement to use index

    Hello expert,
    will you please tell me how to compile the hint to force selection statement to use index?
    Many Thanks,

    Not sure what you mean by compile, but hint is enclosed in /*+ hint */. Index hint is INDEX(table_name,index_name). For example:
    SQL> explain plan for
      2  select * from emp
      3  /
    Explained.
    SQL> @?\rdbms\admin\utlxpls
    PLAN_TABLE_OUTPUT
    Plan hash value: 3956160932
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |    14 |   546 |     3   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| EMP  |    14 |   546 |     3   (0)| 00:00:01 |
    8 rows selected.
    SQL> explain plan for
      2  select /*+ index(emp,pk_emp) */ *
      3  from emp
      4  /
    Explained.
    SQL> @?\rdbms\admin\utlxpls
    PLAN_TABLE_OUTPUT
    Plan hash value: 4170700152
    | Id  | Operation                   | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |        |    14 |   546 |     2   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| EMP    |    14 |   546 |     2   (0)| 00:00:01 |
    |   2 |   INDEX FULL SCAN           | PK_EMP |    14 |       |     1   (0)| 00:00:01 |
    9 rows selected.
    SQL> Hint in the above example is forcing optimizer to use index which resul;ts in a bad execution plan. Most of the time optimizer does not need hints and chooses an optimal plan. In most cases sub-optimal plan is result of stale or incomplete statistics.
    SY.

Maybe you are looking for

  • Problem upgrading from ios 4.3.5 to ios 6.

    Hi all, I'm trying to upgrade my wife's iphone 4 from ios 4.3.5 to ios 6, and I'm getting an error message I can't find a meaning for or a solution to. I'm upgrading via iTunes because "over the air" isn't available to go from 4.3.5 to 6. I've Synced

  • How to get sum in new row (not in a new column) in the query output ?

    There are values in a table like this: A B C D DEsc1 ID1 15 45 DEsc2 ID1 10 67 DEsc3 ID2 12 34 Desc4 ID2 19 32 How to achieve this output : A B C D DEsc1 ID1 15 45 DEsc2 ID1 10 67 --- ID1 25 112 <--- Sum of two rows corresponding to C and D whose B c

  • SELECT query Assistance

    The datastructure for this set-up is 2 tables.  One holds the actual data, one holds the field names.  So for example, tableName holds the fields, employeeFirstName, employeeLastName, employeeStore, and tableAnswers would hold, Bob, Godfrey, Vicksbur

  • Any idea which settings for Leica D LUX 3 RAW files?

    Hello, First time here and I hope this is the correct place for this question. I have just bought a Leica D LUX 3 because I wanted to use raw files for the first time. When I double click the raw file (20MB) PE v4 asks me for pixel dimension size wid

  • Trate de regresar la aplicacion pero me sale imposible conectarse a iTunes store

    Trate de regresar la aplicacion pero me sale imposible conectarse a iTunes store. Le doy click en el mje de la compra en: señalar un problema. Me redirecciona y me sale el mje: iposible conectarse a ITunes Store.