Concatenate columns with distinct values from oracle

Hello gurus,

My gaze of structure of table as follows:

TankListUS TankListCanada TankListIndia

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

T111 | T222 T444 | T222 T555

Now when I run the query:

Select (TL. TankListUS | '||'  || WLM TankListCanada | '||'  || WLM TankListIndia) as "OverallSummary" of TankListTL

I get the output voltage

T111 | T222 | T444 | T222 | T555

But I do not need to duplicate tanks. I need my output like:

T111 | T222 | T444 | T555

Is this possible?

Hello

Try this

with t1 as (select ' T111 | ") T222 | T444 | T222 | T555' double collar).

T2 as (SELECT rownum, REGEXP_SUBSTR (col, ' [^ |] +', 1, RN) SPLIT)

from t1

cross join

(SELECT ROWNUM RN

FROM (SELECT (length (REGEXP_REPLACE (col, ' [^ |] +')) / 2) + 1 MAX_VALUE)

from t1)

connect by level<=>

T3 as (select distinct split as the t2 dis_col)

Select

RTrim (xmlagg (xmlelement (e, dis_col |))) '||')). extract ('/ / text()'), ' |') d_col

Of

T3;

Kind regards

Mohan.

Tags: Database

Similar Questions

  • I have a column with two values, separated by a space, in each line. How to create 2 new columns with the first value in a column, and the second value in another column?

    I have a column with two values, separated by a space, in each line. How do I create 2 new columns with the first value in one column and the second value in another column?

    Add two new columns after than the original with space separated values column.

    Select cell B1 and type (or copy and paste it here) the formula:

    = IF (Len (a1) > 0, LEFT (A1, FIND ("", A1) −1), ' ')

    shortcut for this is:

    B1 = if (Len (a1) > 0, LEFT (A1, FIND ("", A1) −1), ' ')

    C1 = if (Len (a1) > 0, Member SUBSTITUTE (A1, B1 & "", ""), "")

    or

    the formula of the C1 could also be:

    = IF (Len (a1) > 0, RIGHT (A1, LEN (A1) −FIND ("", A1)), "")

    Select cells B1 and C1, copy

    Select cells B1 at the end of the C column, paste

  • OPV with distinct values for the guests

    Hi all

    Could you get it someone please let me know where/what I'm wrong. I created the couple of OPV to get distinct values, as I can't use the view that has millions of data to load guests.

    These OPV is not directly attached to my main table but joined someother tables; After you add the guests in the responses, is to show the below error

    [nQSError: 14070] can't find coverage source logical table to the columns of the logic: [bp Manager]. Please check more detailed level keys are correctly mapped. (HY000)

    I wan to the OPV use only for guests and pass the values to help requested on the main table filters

    I have no warnings/errors in my model. What could be the problem? Thank you for your time

    REDA

    Just go with PSV.

    Check it cool - bi.com for "what happens when we select all the column values.

    Table x got to join the only 1OPV then how can you expect comes from BI to the other 2 open-pollinated varieties? Likewise, we cannot write query!

    If you can create a domain for each OPV then proceed with a command prompt with the UNION of 3 open-pollinated varieties clause

  • update of NULL in the column with the values of the adjacent column

    Examples of data

    with test_data as
    (select 1 as one, null as two, 2 as three,5 as four, 6 as five, null as six from dual
    union all
    select 1 as one, null as two, 2 as three,5 as four, 6 as five, null as six from dual)
    select * from test_data;
    

    This is one of those cases, the case may be where any value of a column can be null

    or two similar columns can be null. If the column is null then I want to update the adjacent column

    average value of the column, if the first column is null so I want to take the next non-null column and update, if the last column is null

    so I want to take prev not zero column and to update.

    In this case would be my expected output

    Un Two Three Four Five Six
    11.52566
    123566

    Prospects for the future the suggesion or advice.

    Or, using Analytics:

    SQL> with test_data (id, one, two, three, four, five, six) as (
      2    select 1, 1   , null, 2   , 5, 6, null  from dual union all
      3    select 2, 1   , null, 3   , 5, 6, null  from dual union all
      4    select 3, 1   , null, null, 5, 6, null  from dual union all
      5    select 4, null, null, null, 5, 6, null  from dual
      6  )
      7  select *
      8  from (
      9    select id
     10         , cell
     11         , case when next_nn is not null and prev_nn is not null
     12             then (next_nn + prev_nn)/2
     13             else nvl(next_nn, prev_nn)
     14           end val
     15    from (
     16      select id
     17           , cell
     18           , val
     19           , last_value(val) ignore nulls over(partition by id order by cell) as prev_nn
     20           , first_value(val) ignore nulls over(partition by id order by cell range between current row and unbounded following) as next_nn
     21      from test_data
     22      unpivot include nulls (val for cell in (one as 1, two as 2, three as 3, four as 4, five as 5, six as 6) )
     23    )
     24  )
     25  pivot ( min(val) for cell in (1 as "ONE", 2 as "TWO", 3 as "THREE", 4 as "FOUR", 5 as "FIVE", 6 as "SIX") )
     26  ;
    
            ID        ONE        TWO      THREE       FOUR       FIVE        SIX
    ---------- ---------- ---------- ---------- ---------- ---------- ----------
             1          1        1,5          2          5          6          6
             2          1          2          3          5          6          6
             3          1          3          3          5          6          6
             4          5          5          5          5          6          6
    
  • Adding a UNIQUE CONSTRAINT to an existing column with duplicate values

    Oracle Forums Hello, I have a table that contains rows 11 901. I tried to define the UNIQUE constraint on the column of xcode, but encountered an error: the column already contain duplicates! I rescued following SQL 'SELECT COUNT (*) FROM States;' the result is 11 901 and 'SELECT COUNT (DISTINCT (xcode)) FROM States;' the result is 11 680. So to enforce this unique key I have to remove the 221 lines. Please how can I do this?

    REMOVE duplicates...

    For example, as

    delete from your_table t
    where rowid <
       (
       select max(rowid)
       from your_table r
       where t.unique_column = r.unique_column);
    

    Thne create the constraint.

  • How to update columns with the value of other lines in the same table

    Hello

    I use Oracle 11.2, I'd use SQL statements to update a column based on values in other rows in the same table. Here are the details:

    create table TB_test (number 4 myId, crtTs date, date of MDPU);

    insert into tb_test (1, to_date ('20110101', 'YYYYMMDD'), null);
    insert into tb_test (1, to_date ('20110201', 'YYYYMMDD'), null);
    insert into tb_test (1, to_date ('20110301', 'YYYYMMDD'), null);
    insert into tb_test (2, to_date ('20110901', 'YYYYMMDD'), null);
    insert into tb_test (2, to_date ('20110902', 'YYYYMMDD'), null);

    After you run the SQL code, I would like to have the following result:

    1, 20110101, 20110201
    1, 20110201, 20110301
    1, 20110301, null
    2, 20110901, 20110902
    2, 20110902, null

    Thanks for your suggestion.

    I guess you need this, otherwise please explain logic correctly:

    SQL> merge into tb_test t
      2  using (
      3    select rowid as rid
      4         , lead(crtts) over(partition by myid order by crtts) as updts
      5    from tb_test
      6  ) v
      7  on (t.rowid = v.rid)
      8  when matched then update
      9   set t.updts = v.updts
     10  ;
    
    5 rows merged.
    
    SQL> select * from tb_test order by 1,2;
    
          MYID CRTTS     UPDTS
    ---------- --------- ---------
             1 01-JAN-11 01-FEB-11
             1 01-FEB-11 01-MAR-11
             1 01-MAR-11
             2 01-SEP-11 02-SEP-11
             2 02-SEP-11
    
  • Populating a drop-down menu form with the values from MySQL database

    I'm creating a simple CMS that will allow staff to add new items on their site (sale of furniture).

    I want them to be able to choose from the list of values for some fields to ensure that the items are displayed on the website correctly (IE to avoid typos etc.).

    I have spent a lot of time to trawl forums and have so far obtained the code below.  When it was working I could only get the dropdown menu options of data contained in the database, as opposed to the list of DEFINED values that initially, I would put in my database.

    For example under the field named 'Type', I assigned these values: all ('table', 'chair', 'buffet', 'convenient', 'bottles', 'library', 'mirror', 'drawers','s chest', 'display', 'tvunit', "bedside", reads, "wardrobe", 'dressingtab', 'blanketbox', 'Office', 'filing cab', "workstation")

    Here's what I want to display in the drop-down, not only the five values of elements already in it.

    However, my CMS page is nothing display now not in the drop down and I can't understand why not!

    So my question is, first of all any ideas what's wrong with my code?  And second, how to fill the bottom of the fall with SET values?

    Thank you very much in advance for your help!

    I didn't want to bore you, then the code below is just the bit that is relevant to my question, rather than any connection $POST and info php etc.

    It is in my code php at the top of my page

     $sql = mysql_query("SELECT DISTINCT id, supplier, room, type, material, finish, bespoke, image FROM furniture ORDER BY ASC");
    
                        while($row = mysql_fetch_assoc($sql))
                        {
                    $supp .= "<option value=\"{$row['supplier']}\">{$row ['supplier']}</option>";
                    $room .= "<option value=\"{$row['room']}\">{$row['room']}</option>";
                    $type .= "<option value=\"{$row['type']}\">{$row['type']}</option>";
                    $material .= "<option value=\"{$row['material']}\">{$row['material']}</option>";
                    $finish .= "<option value=\"{$row['finish']}\">{$row['finish']}</option>";
                    $bespoke .= "<option value=\"{$row['bespoke']}\">{$row['bespoke']}</option>";
                        } 
    

    It's in my html code

    <form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="form1"  id="form1">
    
                    <label for="supplier">Manufacturer</label>
                    <select name="supplier" id="supplier" title="<?php echo $row_add['supplier']; ?>" >
                      <? echo $supp; ?>
                     </select>
           
    
                     <label for="room">Room</label>
                    <select name="room" id="room" title="<?php echo $row_add['room']; ?>" >
                      <? echo $room; ?>
                     </select>
    
                           <label for="type">Type</label>
                          <select name="type" id="type" title="<?php echo $row_add['type']; ?>">
                           <? echo $type; ?>
                          </select>
       
    
                          <label for="material">Material</label>
                          <select name="material" id="material" title="<?php echo $row_add['material']; ?>">
                          <? echo $material; ?>
                              </select>
           
                              <label for="finish">Finish</label>
                          <select name="finish" id="finish" title="<?php echo $row_add['finish']; ?>">
                            <? echo $finish; ?>
                              </select>
       
                           <label for="bespoke">Can be made-to-measure?</label>
                           <select name="bespoke" id="bespoke" title="<?php echo $row_add['bespoke']; ?>">
                          <? echo $bespoke; ?>
                          </select>
    
                                  <input type="Submit" name="Add" id="add" value="Add" />
                          <input name="date" type="hidden" id="hiddenField" value="<?php echo $todayis['date']; ?>">
                          <input type="hidden" name="MM_insert" value="form1" />
                          </form>
    

    > So, don't you think not with my different approach?

    Yep, that's how it should be done.

    Note the OP also mentioned that they are filled with 6 drop-down lists:

    > 6 fields I want to post, drop downs in my a form are: provider, room, type of material, finish and custom.

    So you can create a table for each separate... but what I would probably do is store everything in a single table (depends of if you need to store additional information or if it's just a list of choice):

    optionsTbl

    Category ID value

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

    1 provider abc

    2 vendor xyz

    3 living room

    4 dining

    Enter values using a set of multiple records in the query: Select value of optionsTbl category WHERE = 'suppplier. " Select the value optionsTbl category = "room"; etc.

    Then fill the drop-down lists by looping through each query in the recordset and use next_result() to perform a loop on the next game.

  • How to build a collection ArrayCollection with distinct values of an XMLListCollection?

    Hello, I'm really bad with what seems like it should be a very simple task. I have a XML of course object which consists of only the names of course. I just want to create a new collection of ArrayCollection which consists of only the names of DISTINCT/UNIQUE course in the XML list to use in a combobox control. I tried all sorts of things but nothing I try seems to work. I have a few listed below MXML.

    Any help would be appreciated! Should be simple im sure, and once I understood that, it will make my app built much easier! The value of myDistinctData is the final ArrayCollection collection. For simplicity, I left my attempts failed the loop foreach. THANKS TO ANYONE WHO CAN OFFER HELP!

    MXML CODE:

    <? XML version = "1.0" encoding = "utf-8"? >
    "" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' layout = "horizontal" initialize = "GB (); ">

    < mx:Script >

    <! [CDATA]
    Import mx.collections.ArrayCollection;

    [Bindable]
    public var myDataDistinct:ArrayCollection

    public void go (): void {}

    var myData:XML =

    < course >
    < course cid = "1" >
    < name > course 1 < / name >
    < / course >
    < course cid = "2" >
    < name > course 1 < / name >
    < / course >
    < course cid = "3" >
    < name > course 2 < / name >
    < / course >
    < course cid = "4" >
    < name > course 3 < / name >
    < / course >
    < course cid = "5" >
    < name > course 1 < / name >
    < / course >
    < course cid = "6" >
    < name > course 3 < / name >
    < / course >
    < / course >;

    for each {(thisCourse:XML var in myData)

    -SOME CODE THAT CREATES A TABLE OF DISTINCT VALUES GOING HERE?
    }
    }
    []] >

    < / mx:Script >

    < mx:Label text = "names of separate courses:" / > ""
    < mx:ComboBox dataProvider = labelField "{myDataDistinct}" = "" / >

    < / mx:Application >


    I don't know how to remove duplicates in an ArrayCollection collection or otherwise.
    But since you already have an XML and require only a text node inside.
    I go through the easiest way.

    Please take a look


    http://www.Adobe.com/2006/mxml"layout ="horizontal"initialize ="GB (); » >

    Import mx.collections.ArrayCollection;

    [Bindable]
    public var myDataDistinct:ArrayCollection

    public void go (): void {}

    var myData:XML =

    Course 1


    Course 1


    Course 2


    Course 3


    Course 1


    Course 3

    ;

    you need to do collection here ArrayCollection instance before put something u.
    this.myDataDistinct = new ArrayCollection();

    E4X selection
    var xmlList:XMLList = myData.course.name;

    for each (var xml in xmlList)
    {
    trace (XML); you will see that we have now.
    var str:String = new String (xml);
    var flag: Boolean = true;
    for (var i: Number = 0; i
    {
    If (this.myDataDistinct.getItemAt (i) == STR)
    {
    flag = false;
    break;
    }
    }
    if(flag==true) {This.myDataDistinct.AddItem (STR) ;}
    }
    }
    ]]>



  • Fill an input array with the values from the worksheet

    Is it possible to fill an input array with the values to a text file or a spreadsheet? If so, how do you?

    Thanks to GerdW and all who responded. Fill a table control using a local variable with "The spreadsheet file read" as he entered works perfectly.

  • Problem with the connection from Oracle to MS Excel - 64 bit

    Hello

    I have problem connecting Excel to oracle 11.2 using DG4ODBC.

    OS - Windows 7 64 bit

    Database version: - Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64 bit

    Created system using ODBC DSN:

    Name of Data Source = test12

    Oracle home path:-D:\app\11g64db\product\11.2.0\dbhome_1

    Contents of the initdg4odbc.ora file:

    # This is an example of initialization file of the agent that contains the HS settings

    # necessary for the database to ODBC gateway

    #

    # HS init parameters

    #

    Test12 = HS_FDS_CONNECT_INFO

    HS_FDS_TRACE_LEVEL = 255

    #

    # Required for the non-Oracle system environment variables

    #

    #set < varenv > = < value >

    Content of listener.ora:

    listener.ora # Network Configuration file: D:\app\11g64db\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora

    # Generated by Oracle configuration tools.

    SID_LIST_LISTENER =

    (SID_LIST =

    (SID_DESC =

    (GLOBAL_DBNAME = live)

    (ORACLE_HOME = D:\app\11g64db\product\11.2.0\dbhome_1)

    (SID_NAME = live)

    )

    (SID_DESC =

    (PROGRAM = dg4odbc)

    (SID_NAME = dg4odbc)

    (ORACLE_HOME = D:\app\11g64db\product\11.2.0\dbhome_1)

    )

    )

    LISTENER =

    (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost) (PORT = 1521))

    )

    ADR_BASE_LISTENER = D:\app\11g64db

    Content of tnsnames.ora:

    tnsnames.ora # Network Configuration file: D:\app\11g64db\product\11.2.0\dbhome_1\network\admin\tnsnames.ora

    # Generated by Oracle configuration tools.

    excel_test =

    (DESCRIPTION =

    (ADDRESS = (PROTOCOL = tcp)(HOST=localhost) (PORT = 1521))

    (CONNECT_DATA = (SID = dg4odbc))

    (HS = OK)

    )

    SCREW =

    (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost) (PORT = 1521))

    (CONNECT_DATA =

    (SERVER = DEDICATED)

    (SERVICE_NAME = live)

    )

    )

    Status of the listener

    LSNRCTL for 64-bit Windows: Version 11.2.0.4.0 - Production on August 29, 2014 13:56

    : 11

    Copyright (c) 1991, 2013, Oracle.  All rights reserved.

    Connection to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST=localhost) (PORT = 1521)))

    STATUS of the LISTENER

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

    Alias LISTENER

    TNSLSNR for Windows 64-bit version: Version 11.2.0.4.0 - Prod

    ction

    Start date August 29, 2014 13:34:58

    Uptime 0 days 0 h 21 min 12 sec

    Draw level off

    Security ON: OS Local Authentication

    SNMP OFF

    Listener parameter File D:\app\11g64db\product\11.2.0\dbhome_1\network\admin\l

    istener.ora

    Listener log file D:\app\11g64db\diag\tnslsnr\Est-Subramanya\listener\al

    ert\log. XML

    Summary of endpoints listening...

    (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp)(HOST=127.0.0.1) (PORT = 1521)))

    Summary of services...

    Service "dg4odbc" has 1 instance (s).

    "Dg4odbc" instance, status UNKNOWN, has 1 operation for this service...

    Service 'live' has 2 occurrences.

    Instance of "live" status UNKNOWN, has 1 operation for this service...

    Instance of "live" READY State, has 1 operation for this service...

    Service 'visXDB' has 1 instance (s).

    Instance of "live" READY State, has 1 operation for this service...

    The command completed successfully

    DB Link:

    CREATE DATABASE LINK PUBLIC TEST123 USING 'excel_test ';

    error when querying of data:

    Select * from test@test123;

    ORA-28500: connection between ORACLE and a non-Oracle system has sent this message:

    ORA-02063: preceding line TEST123

    28500 00000 - "connection between ORACLE and a non-Oracle system has sent this message:

    * Cause: The cause is explained in the forwarded message.

    * Action: See documentation for the non-Oracle of the transmission system

    Message.

    Error on line: 1 column: 20

    Appreciate the help in advance...

    Thank you...

    This problem is solved. It was because of the excel 12.0 version when creating data source in administrative tools.

    Thank you.

  • Return only the columns with different values.

    Hi all

    I am trying to solve a seemingly trivial problem but can't seem to get any clear answer anywhere in any forum. Consider a single table with 5 columns and only two lines:
    row_id           first_name         last_name        age            gender
    1                    John                  doe               27             M
    1                    Jane                  doe               27              F  
    Assume that there is no primary key or any other constraint. Also assume that there are only and only two lines of this table. So I need basically a query that, overall above lines, would return first name and sex, because they are only different columns in two lines, as well as their values. Even if I can get sort of column names that are different and that would be enough that I can easily access the values later. It is also important to remember that I may not know the names of the columns in the columns, so basically, somehow, I use user_tab_columns in the process.

    Any help appreciated.

    Published by: 894302 on May 1, 2013 10:35

    Hello

    894302 wrote:
    The exact release could be just a varchar variable that lists all the columns that have different values with each column name separated by commas. We'll call the query you want as a QUERY. So, if I do something like

    Select the REQUEST of double; Output should be: 'first_name, equality of the sexes. Is this possible?

    In this case:

    SELECT     RTRIM ( DECODE (a.row_id,     b.row_id,     NULL, 'row_id,')     ||
                    DECODE (a.first_name, b.first_name, NULL, 'first_name,') ||
              DECODE (a.last_name,  b.last_name,  NULL, 'last_name,')  ||
              DECODE (a.age,        b.age,          NULL, 'age,')      ||
              DECODE (a.gender,     b.gender,     NULL, 'gender,')
               , ','
               )          AS different_columns
    FROM     rhit_table_x  a
    JOIN     rhit_table_x  b  ON  a.ROWID     < b.ROWID
    ;
    

    Output:

    DIFFERENT_COLUMNS
    ---------------------------------------
    first_name,gender
    

    This assumes that you have really a table, then you can use ROWID to distinguish the lines, since there is no primary key.
    If this isn't the case, you first assign ROW_NUMBER in a subquery.

  • Fill two empty columns with the values in a column (all in the same table)

    Can someone point me in the right direction? I want to fill the column prefix and suffix with the AcctNum data.

    "Prefix is the part of the number before the '-' and the suffix is everything after the '-'. '. Write a SQL command to fill the column prefix and suffix.
    *Accounts* 
    
    AcctNum   Prefix   Suffix
    -------   ------   -------
    123-0097
    X089-056
    123-0097
    123-0098
    F3377-D
    X089-057
    X089-058
    3-009712
    It is supposed to look like this:
    *Accounts* 
    
    AcctNum   Prefix   Suffix
    -------   ------   -------
    123-0097    123     0097
    X089-056
    123-0097
    123-0098
    F3377-D
    X089-057
    X089-058
    3-009712
    That's what I came with, but it does not work because it is basically putting multiple values into a single cell:
    update accounts
         set prefix=(select substr(acctnum, 1, instr(acctnum,'-')-1) from accounts),
         suffix=(select substr(acctnum, instr(acctnum, '-')+1) from accounts)
         where acctnum=(select prefix||'-'||suffix from accounts);
    I want this query is incredibly easy and I have forget something. Any help is greatly appreciated.

    Published by: 885913 on September 18, 2011 12:53
    UPDATE accounts a
    SET    ( prefix, suffix ) = (SELECT Substr(acctnum, 1, Instr(acctnum, '-') - 1),
                                        Substr(acctnum, Instr(acctnum, '-') + 1)
                                 FROM   accounts b
                                 WHERE  a.acctnum = b.acctnum);
    
  • ORDER BY a column with NULL values only

    Hello

    The order of column has all null values for the results of my query set.

    Ex:

    Select a, b, c from table1 where type = 'type1' and ID = "id1" order by column1

    In the above query, "column1" contains nulls for 'type1 '. The order of the records in the result set is different for different ID values if the values of a, b and c are always the same.
    What is happening in the 10g database.

    I have also observed that the order of the records for the same query conforms in the 9i database.

    (1) is the difference due to the difference in versions of database?
    (2) is there a way to get the order even records independently entry ID?
    (3) I cannot in the same order in 10 g DB too as the order in 9i DB?

    Thank you.

    Hello

    Madhuri says:
    Hello

    The order of column has all null values for the results of my query set.

    Ex:

    Select a, b, c from table1 where type = 'type1' and ID = "id1" order by column1

    In the above query, "column1" contains nulls for 'type1 '. The order of the records in the result set is different for different ID values if the values of a, b and c are always the same.
    What is happening in the 10g database.

    I have also observed that the order of the records for the same query conforms in the 9i database.

    If two or more rows have the same values (or NULL) for each ORDER BY expressions, then you may not be sure what order they will be. The system is free to do whatever he finds convenient. What the system identifies Dresser can vary depending on many factors, including the version, the size of the table, the conditions in the WHERE clause, there is a GROUP BY clause, or not... In all cases, it is not something that you can depend on. If you want the output in a certain order, to specify the order in the ORDER BY clause.

    (1) is the difference due to the difference in versions of database?

    Could be. In all versions, Oracle said that you cannot count on the order being compatible, except if the ORDER BY clause, it is consistent.

    (2) is there a way to get the order even records independently entry ID?

    Add more expressions at the end of the ORDER BY clause, as tie-breakers.
    For example:

    ORDER BY  column1
    ,         a
    ,         b
    ,         c
    

    If table1 is really a table (not a view), you can add a ROWID.
    In most cases, you can ORDER BY expressions that are not in the SELECT clause. So if you have a primary key, you can usually ORDER BY it, even if you don't see it.

    (3) I cannot in the same order in 10 g DB too as the order in 9i DB?

    Of course, ORDER BY works the same in all versions. If you have an ORDER BY clause to unambiguously, the output will be exactly the same order in any version.
    Remember that the absence of ORDER BY has no effect in all versions. If you have an ORDER BY of ambiguous clause, you can not count on the coming out in a particular order in any version.

  • Filter a column with the value of another

    Hello. Hope someone can help with this... On my search page, I want to use the value of the first list/drop-down menu to filter the values of the second list/menu. I use PHP and DW 8.0.2.

    Example: The first column has each of the 50 States. second column has 3 000 counties. If a user selects New Jersey, I want to just 21 NJ counties to appear as options in the second menu downwards rather than 3 000 counties.

    First Recordset works very well for the States. But in my second recordset, I say 'select distinct County of the said County WHERE AS var1'... and var1 is $recordset1 [County]. But the 2 column is empty. How can I actively pass the value of the first column in the second while the user is still on the same page?

    Sandman

    >>
    Assuming that your table has a field named "State":
    «select County of States WHERE state = "var1""
    >>

    You can use this solution when the first menu page 1 and the second menu on page 2 (IE passing the value of a query on page 2), but as assumingly, you need to have this functionality within a single page, basic need based on a javascript solution 'drop-down menus of dynamic load' to load the menu2 - options "in situs.

    There is an extension for Dreamweaver stand alone for this on the site of Tecnorama , that also wants to work without the relationships between the tables, in other words, with the data in a table, which matches your scenario.

  • String column with some formats from date to date

    Hello!
    IM new in Oracle :)
    I need to convert a string column {VARCHAR2 (70 bytes)} to this day. But this column have some type os dates... I found three types:

    17/02/12 06:00:04, 403398 - 02:00
    19 MARCH 12 06.00.07.936287 AM - 03:00
    06:00:03:000 30/03/2012

    How can I convert this column to date? I have hours, just need the date...
    IM using Oracle 10 g.

    Thank you very much!

    EdStevens wrote:
    Someone better than me can probably provide some ideas on exactly how to analyze the current value of VARCHAR_DATE

    The fact is that any analysis fails for a date like 10/11/12.
    You have only one chance if you know for sure that the order of the months of the year and the day is always the same. otherwise you can only guess.

    If guess is good enough depends on the importance of the process of using it for the success of your business...

    Good bye
    DPT

Maybe you are looking for