Need small help in query

Hi,
Cancel the request. i have resolved its my own.
Thanks for all your help...
Edited by: user586 on Oct 31, 2011 7:42 PM

Learn about the Workspace Management functions ... demo here:
http://www.morganslibrary.org/reference/wm_functions.html
It is best to not reinvent the wheel.

Similar Messages

  • Need small help

    Hi,
    I need small help in sql*loader.I get data-files which has a particular identified on the 1st record( header ), based on which I've to load a constant for the 1st column of every row. How do I set in the control file.
    Appreciate if someone can give me directions on this.
    Thanks in advance,

    Hi again!
    I hope that a little shell script will do the thing for you.
    1.) Create the following BASH-Script
    #!/bin/bash
    export CUSTNO=""
    export CUSTNO=$(awk -F"," '{print NR " " $3}' datafile.csv | grep 1 | cut -d" " -f2)
    sed -i 's/#x#/'$CUSTNO'/g' controlfile.datI've use datafile.csv as the name of the datafile to load and controlfile.dat as the name of your controlfile. Please change this to fit your needs.
    This script looks for the occurrence of your constant value and stores this value in the variable CUSTNO. Then it look for a string #x# in your controlfile and changes #x# to the value of CUSTNO.
    So in your controlfile there should be a line for custno like that:
    custno                     CONSTANT '#x#'This line will be replace in your example to:
    custno                     CONSTANT '35642'To get this to work I assume that:
    1.) Your constant value is always at the third position in the header of your datafile.
    2.) You've made the change with #x# in your controlfile.
    I hope that this is really usefull to you.
    Best Regards
    Florian W.

  • Help need small help

    ferst this is my pc
    4.09.00.0904 (DirectX 9.0c) ante-HA0X2NT8F0  : CPU الـ Intel Pentium 4 530, 3033 MHz (15 x 202) MSI 848P Neo-V (MS-6788) (5 PCI, 1 AGP, 2 DDR DIMM, Audio)  Intel Breeds Hill i848P ram512 mb(DDR SDRAM) BIOS نوع الـ AMI (11/29/04) Communications Port (COM1) ECP Printer Port (LPT1) RADEON 9250 - Secondary (128 mb) RADEON 9250 (128 mb) ATI Radeon 9250 (RV280) Plug and Play Monitor [NoDB] (105169121) : sound cart Intel 82801EB ICH5 - AC'97 Audio Controller
     : IDE  Standard Dual Channel PCI IDE Controller Floppy disk drive HDS728080PLAT20 (قب 80, 7200 RPM, Ultra-ATA/133)   CD-ROM Drive SMART
    now
    1-my pc restart it self after 4 or 5 h....
    no cbu hot
    no fan error cut i test all
    2-i wanna get update all driver
    i try with the msi brogram and that brogram give me an old v. :((
    3-is my pc (top)(good)(strong) if not i will buy new msi one only tell me
    waiting

    when take look thare i see 12v_____
    euer-power tx 12v
    pl-350 8a 5a max 200w (isthat good )?
    hi Din
    let me ask how i can do this ?(memtest )????
    pls i wanna small help and i wanna know >is my pc good or bad cuz it cust me mush
    and all my pc from MSI !.
    HI Ralphdb
    (((Do you know what temp your Cpu is running)))) no i dont know that i am not professional  in pc hard..so pls be soft with me and explain  ...

  • Friends need ur help in query

    SELECT      AL_ID,AL_CAPTION FROM ALB WHERE AL_MEMBERID=8
    UNION      
    SELECT      VD_ID,VD_CAPTION FROM VDSF WHERE VD_MEMBERID=8
    ORDER BY 2;
    This is my result set for the query
    3     Bunch
    4     New
    5     falss
    Actually it displays in the Order by Case Sensitive, i want it in the order
    3     Bunch
    5     falss
    4     New
    Is this possible, if then please help without changing the Case Sensitive of the Data
    Thanks,
    Dick...

    Hey I think the only problem with your query was use of same name
    select AL_ID,AL_CAPTION
    from
    SELECT AL_ID,AL_CAPTION FROM ALB WHERE AL_MEMBERID=8
    UNION
    SELECT VD_ID,VD_CAPTION FROM VDSF WHERE VD_MEMBERID=8
    ORDER BY upper(AL_CAPTION);
    AL_ID and AL_CAPTION .So an alias is needed for order by otherwise It will confuse AL_CAPTION as the AL_CAPTION inside from().

  • Need Tuning help in query

    Hi,
    I have aquery which looks like this
    CREATE TABLE BKP3
    PARALLEL(DEGREE 4 INSTANCES 1)
    NOLOGGING
    AS
    SELECT /* + PARALLEL(4,1) */ *
    FROM BKP2 A
    WHERE A.COL1 NOT IN (SELECT /* + PARALLEL(4,1) */ COL1
    FROM BKP1)
    AND A.COL2 NOT IN (SELECT /* + PARALLEL(4,1) */ COL2
    FROM BKP1)
    AND ROWNUM<=5000000;
    Table BKP1 holds more than 5million rows and table BKP2 holds more than 60million rows.
    This query is very slow. Is there any way i can improve the performance.
    Kindly help.

    > I dont know how but somehow i am unable to run the explain plan.
    What have you tried and what error did you get?
    What is your Oracle version?
    In 10g I think sys.plan_table$ is granted public access by default. Try using this handy Explain Plan script in SQL*Plus:
    www.williamrobertson.net/code/xplan.sql

  • Need a help in query

    Hi,
    It' s duplicate thread...deleted
    Edited by: user586 on Mar 23, 2011 9:42 AM

    Hi,
    You should do two regular expression operations.
    First, extract just the part of the string that is between the parentheses. Use that substring, and not the full string, in the rest of the query.
    After that, you can use REGEXP_SUBSTR the way you were doing.
    You should devise a way to test all your strings at once, without having to type the same string more than once.
    I used this table to test:
    CREATE TABLE     table_x
    (      txt     VARCHAR2 (40)
    INSERT INTO table_x (txt) VALUES ('TECHPKG(INTELLI CC+FRT SONAR)');
    INSERT INTO table_x (txt) VALUES ('PWRPKG(P/W+P/L+CC)');Here's my solution:
    WITH   got_paren_txt     AS
         SELECT     REGEXP_REPLACE ( txt
                          , '^.*\((.*)\).*$'
                          , '\1'
                          )     AS paren_txt
         FROM    table_x
    ,       got_item_cnt AS
         SELECT     PAREN_txt
         ,     1 + LENGTH (paren_txt)
                - LENGTH ( REPLACE ( paren_txt
                                      , '+'
                      )     AS item_cnt
         FROM    got_paren_txt
    ,     cntr     AS
         SELECT     LEVEL     AS n
         FROM     (
                   SELECT  MAX (item_cnt)     AS max_item_cnt
                   FROM     got_item_cnt
         CONNECT BY     LEVEL     <= max_item_cnt
    SELECT       i.paren_txt
    ,       c.n
    ,       REGEXP_SUBSTR ( i.paren_txt
                           , '[^+]+'
                   , 1
                   , c.n
                   )     AS item
    FROM       got_item_cnt  i
    JOIN       cntr          c  ON   c.n  <= i.item_cnt
    ORDER BY  i.paren_txt
    ,            c.n
    ;and its output:
    PAREN_TXT                               N ITEM
    INTELLI CC+FRT SONAR                    1 INTELLI CC
    INTELLI CC+FRT SONAR                    2 FRT SONAR
    P/W+P/L+CC                              1 P/W
    P/W+P/L+CC                              2 P/L
    P/W+P/L+CC                              3 CCThis assumes that each string will contain a '(', followed by a ')'. If you can have multiple sets of parentheses in the same string, the query above can be adjusted. Post some sample data that shows what kinds of strings you might need to handle, and the results you want from them.
    Whenever you post a question, say what version of Oracle you're using. The query above will work in Oracle 10, but it could be simplified in Oracle 11 using REGEXP_COUNT and the new version of REGEXP_SUBSTR.

  • Need some help with query

    Hey all, I have the following scenario,
    Table A
    Column1
    2
    3
    5
    Table B
    Column2
    7
    5
    4
    Table C
    Column1, Column2
    2,7
    3,8
    5,10
    So basically I need to compare in a way that the combination of the values in A AND B match the recordset in C as such,
    select column1, column2 from Table A, Table B
    where a combination of both those columns exists in Table C. Therefore in the above example, this query should return "2,7" as the output. Any ideas would be appreciated.

    This should do?
    SQL> select c.col1, c.col2
      2  from c
      3  where (c.col1, c.col2) in (select col1, col2
      4                            from (select c.col1 col1
      5                                  from C, a
      6                                  where c.col1 = a.col1) q1
      7                                ,(select c.col2 col2
      8                                  from C, b
      9                                  where c.col2 = b.col1) q2
    10                            )
    11  /
          COL1       COL2
             2          7Cheers
    Sarma.

  • Need urgent help with query....

    i need to print loc field with it but the logic is get ti loc code where the month is maximum...
    Need output like this
    K  Loc            M_1        M_2        M_3        M_4        M_5        M_6
    A   1     2.5        4.5          0          0          0          0
    B   4        0          0          0          0        2.5          0
    C  3       2.5        2.5        2.5        2.5        2.5        2.5
    drop table y;
    create table y( key char(1),
              loc number,
              month char(2),
              amnt number);
    insert into y values('A',2,'01',2.50);
    insert into y values('A',1,'02',4.50);
    insert into y values('B',4,'05',2.50);
    insert into y values('C',2,'01',2.50);
    insert into y values('C',8,'02',2.50);
    insert into y values('C',3,'03',2.50);
    insert into y values('C',3,'04',2.50);
    insert into y values('C',3,'05',2.50);
    insert into y values('C',3,'06',2.50);
    commit ;
    select key
    ,sum(decode(month,'01',amnt,0)) m_1
    ,sum(decode(month,'02',amnt,0)) m_2
    ,sum(decode(month,'03',amnt,0)) m_3
    ,sum(decode(month,'04',amnt,0)) m_4
    ,sum(decode(month,'05',amnt,0)) m_5
    ,sum(decode(month,'06',amnt,0)) m_6
    from y
    group by key;
    SQL> select key
      2  ,sum(decode(month,'01',amnt,0)) m_1
      3  ,sum(decode(month,'02',amnt,0)) m_2
      4  ,sum(decode(month,'03',amnt,0)) m_3
      5  ,sum(decode(month,'04',amnt,0)) m_4
      6  ,sum(decode(month,'05',amnt,0)) m_5
      7  ,sum(decode(month,'06',amnt,0)) m_6
      8  from y
      9  group by key;
    K        M_1        M_2        M_3        M_4        M_5        M_6
    A        2.5        4.5          0          0          0          0
    B          0          0          0          0        2.5          0
    C        2.5        2.5        2.5        2.5        2.5        2.5

    Well, maybe I'm lucky to understand here ?
    SQL> select
    2   key
    3  ,max(loc) keep (dense_rank last order by
    amnt,month) loc
    4  ,sum(decode(month,'01',amnt,0)) m_1
    5  ,sum(decode(month,'02',amnt,0)) m_2
    6  ,sum(decode(month,'03',amnt,0)) m_3
    7  ,sum(decode(month,'04',amnt,0)) m_4
    8  ,sum(decode(month,'05',amnt,0)) m_5
    9  ,sum(decode(month,'06',amnt,0)) m_6
    10  from y
    11  group by key;
    K        LOC        M_1        M_2        M_3
    M_4        M_5        M_6
    A          1        2,5        4,5          0
    0          0          0
    4          0          0          0          0
    2,5          0
    3        2,5        2,5        2,5        2,5
    2,5        2,5Nicolas.
    This should be more a question for SQL and PL/SQL
    Forum :
    PL/SQL
    start=0
    Message was edited by:
    N. GasparottoPerfect..... many thanks... and i am sorry i put this in this forum rather than in SQL/PLSQL... but you are the best!!
    thanks to all of you..

  • I need small "HELP" who is good on scripting

    explame:
    if iframe "www.site.com" = true then /Means! that "www.site.com" is currectly on browser navigator HTML url..
    iframe navigate "www.site2.com" /If "www.site.com"  is true on navigator HTML url. then they navigate another url "www.site2.com"
    Can u translate it in script (dreamweaver)
    explame:
    if (text)
    ( text )
    any helps?

    I'm not sure but maybe the OP is asking how to make a link inside an iframe launch a 2nd website in a new window.
    Nancy O.

  • Need Small Help with Arrays.

    I have this question i wanna ask...Could anyone help me with this code.
    Assume that the array arr has been declared. how do i write a statement that assigns the next to last � element of the array to the variable x , which has already been declared.

    Of course, if you don't know the size until run time, you'll want to check that the array size is greater than 1, else there won't BE a next to last element.

  • Need small help with idvd

    im useing idvd to finish this hight light i have made for my aunt and uncles 6man football team and they have 9 players on their team and on the template im useing only has 8 drop boxes i would like to add one more so i can put the players football pictures in there in front of the team photo and dont want to leave one player out if anyone could help me that would be awesome
    thank in advance

    There's a theme titled Portfolio with 10 photo spaces in the menu drop zone.  You could use that and fill in the other 3 with group shots or something similar.
    OT

  • I need a help in query

    Dears,
    i want to create a report which shall work on OU basis, and the output should be as:
    ORG_NAME  SUB_INVENTORY_CODE     SUB_INVENTORY_NAME     CUSTOMER_NUMBER     CUSTOMER_NAME     ORDER_TYPE_NAME
    any help ?

    Dears,
    i want to create a report which shall work on OU basis, and the output should be as:
    ORG_NAME  SUB_INVENTORY_CODE     SUB_INVENTORY_NAME     CUSTOMER_NUMBER     CUSTOMER_NAME     ORDER_TYPE_NAME
    any help ?

  • I need a help with query

    hello all,
    {code}
    create table balance
    (open_balance  number(4)
    ,qty_in                   number(4)
    ,qty_out                number(4)
    insert into balance values (200,1,0);
    insert into balance values ('',0,-25);
    insert into balance values ('',0,-20);
    {code}
    i need a result like this
    {code}
    OPEN_BALANCE QTY_IN QTY_OUT RESULT
             200      1       0    201
                      0     -25    185
                      0     -20    165
    {code}

    Hi,
    u0597684 wrote:
    hello all,
    {code}
    create table balance
    (open_balance  number(4)
    ,qty_in                   number(4)
    ,qty_out                number(4)
    insert into balance values (200,1,0);
    insert into balance values ('',0,-25);
    insert into balance values ('',0,-20);
    {code}
    i need a result like this
    {code}
    OPEN_BALANCE QTY_IN QTY_OUT RESULT
             200      1       0    201
                      0     -25    185
                      0     -20    165
    {code}
    There is no built-in order to rows in a relational table.  I assume you have some other column that tells what order the rows are in, like this:
    CREATE TABLE  balance
    ( open_balance  NUMBER (4)
    , qty_in        NUMBER (4)
    , qty_out       NUMBER (4)
    , trans_dt DATE
    insert into balance (open_balance, qty_in, qty_out, trans_dt) values (200,  1,  0,  DATE '2013-05-31');
    insert into balance (open_balance, qty_in, qty_out, trans_dt) values (NULL, 0, -25, DATE '2013-06-07');
    insert into balance (open_balance, qty_in, qty_out, trans_dt) values (NULL ,0, -20, DATE '2013-06-14');
    This looks like a job for the analytic SUM function.
    Here's one way:
    SELECT    b.*
    ,   SUM ( NVL (open_balance, 0)
           + qty_in
           + qty_out
           ) OVER (ORDER BY trans_dt) AS result
    FROM      balance  b
    ORDER BY  trans_dt
    The results are slightly different from what you posted:
    OPEN_BALANCE     QTY_IN    QTY_OUT TRANS_DT        RESULT
             200          1          0 31-May-2013        201
                          0        -25 07-Jun-2013        176
                          0        -20 14-Jun-2013        156
    If you really want the results you requested, please explain how you get them.

  • Need small help in data retriving

    Hi ALL...
    I have the ship_to_party no. In this ship to party no i have multiple deliviries. In the deliveries i have mutiple material numbers.
    These ship to party and delivery no are populating form these strctures.
    VBDPL-MATNR (Material Number) -- item
    VBDKL-KUNWE (Sold 2 party) --- header
    now i need to populate the KDMAT feild from LIPS. So what should i do to populate the feild.
    regards
    arjun

    Hi,
    could you tell me the name of the object you are using ?
    Regards
    Shiva

  • Need a help to write the query

    Hi,
    I need a small help to write the query.
    I have a table contains couponid,coupon,createdate,expirationdate,assigndate from couponday table
    i want to write the query to select the coupon whose Expiry date in the table is NOT within 30 days.
    Thanks in advance

    Hi,
    user586 wrote:
    i want to write the query to select the coupon whose Expiry date in the table is NOT within 30 days.If you mean expirationdate (datatype: DATE) is not within 30 days (past or future) of run time, then:
    SELECT  coupon          -- or whatever columns you want
    FROM    table_x
    WHERE   expirationdate  NOT BETWEEN  SYSDATE - 30
                                AND      SYSDATE + 30
    ;

Maybe you are looking for