Output in different order than in select statement.

I'm executing the following query. Just wondering if I'm missing something:
select a.constraint_name, a.table_name, a.r_constraint_name, b.column_name, c.table_name, c.column_name from user_constraints a
inner join user_cons_columns b on (a.table_name=b.table_name and a.constraint_name=b.constraint_name)
inner join user_ind_columns c on (a.r_constraint_name=c.index_name)
where a.r_constraint_name='QUE_PK' and b.position=c.column_position
order by b.position
(replace QUE_PK with your own primary key referenced in a foreign key)
The columns appearing in the resultset are in different order than in the select statement.
They came as follows: constraint_name, r_constraint_name, table_name, table_name, column_name, column_name. If I aliase one of the column, the result set is ok.
I'm using version 1.1.0.23 on Ubuntu 6.10 against a 10g r2.

To double check, you can go to <sqldeveloper>/system/oracle.sqldeveloper.1.1.0 (this may be <user_dir>/system/oracle.sqldeveloper.1.1.0 on your computer) and delete all of the *TableSettings.xml files. That will erase any custom column orders that you may have saved.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Execute an sql command other than an select statement

    hello,
    is it possible to execute an sql-command other than a
    select statement in a report ?
    something like execute ... ?
    i want ro execute a statement BEFORE the select ...
    or is the one and only possible statement in a report
    a "select ?"
    greetings
    Thorsten Lorenz

    Hi ,
    You can always use the Report triggers to execute any other SQL commands . If you need to execute them before the SELECT statement of you Data Model query , then You can use the Parameter Form triggers / before Report Trigger. Be sure to put in a commit statement as well, if the result of the Select statement you intend to do depends on these SQL commands.
    Thanks
    Oracle Reports Team.

  • How to : rownum and order by in select statement

    Say I have a select statement with additional 'order by' clause.
    The result set I want prepended by the rownum column.
    But, and here comes the flaw, I want the rownum for the already ordered result set
    not the unordered.
    An example:
    select firstname, lastname from myTable order by lastname;
    When I add the rownum to the select clause,
    'select rownum, firstname, lastname from myTable order by lastname;'
    I might get something like:
    20 Mike Adams
    13 Nina Bravo
    1 Tom Charlie
    But I want the following result:
    1 Mike Adams
    2 Nina Bravo
    3 Tom Charlie
    I could now
    'Select rownum, lastname, firstname from (select firstname, lastname from myTable order by lastname);
    But I guess there is a better way!?!
    which is the best way to accomplish that?
    Thanks for your advice!

    >
    'Select rownum, lastname, firstname from (select firstname, lastname from myTable order by lastname)
    >
    Well if you ask me there is very little difference between this query and the above query
    select rownum, lastname, firstname from mytable;Because rownum is assigned before the order by. The difference is in your query you are assigning a rownum to an ordered resultset but still there is no guarantee oracle is going to read the data in an ordered fashion. In the second query rownum is assigned to an unordered resultset. Again it is the samething. So if you want to guarantee it then I will go for the following option
    select row_number() over(order by lastname) rn, lastname, firstname from mytable
    order by lastnameAlso check this link.
    http://www.oracle.com/technology/oramag/oracle/07-jan/o17asktom.html
    Regards
    Raj
    Edited by: R.Subramanian on Jan 13, 2009 6:20 AM

  • Why is the thumbnail images placed in different order than the xml?

    Hi all!
    This same code I have asked about before, and got excelent help, but this is a different problem so I just start a new thread.
    This is a code that open a XML file, containing a small list of images, and place them as thumbs on the page.
    It kinda work now, but the funny thing is, the order of the thumbs is totally scrambled compared to the xml list, and I can't just see why!
    It has something to do whith when the loaders gets transfered via addEventListener to the placePics function, more than that I cant find out!
    There may be the better way to put up this code. I just feel putting it up in two nested addEventListeners like this is not the best of practice. But I see no other way here...
    package {
         import flash.display.*;
          import flash.events.*;
          import flash.net.*;
          public class thumbHolder extends MovieClip {
                var xmlRequest:URLRequest;
                var xmlLoader:URLLoader;
                var imgData:XML;
                var numberOfChildren:Number;
                var currentImgNum:Number;
                var imgLoader:Loader;
                var imgContainer:Array = [];
                var currentImg:String;
                public function thumbHolder() {
                      currentImgNum = 0;
                      xmlRequest = new URLRequest("images.xml");
                      xmlLoader = new URLLoader(xmlRequest);
                      xmlLoader.addEventListener(Event.COMPLETE, handlePics);
                public function handlePics(e:Event):void {
                      imgData = new XML(e.target.data);
                      numberOfChildren = imgData.*.length();
                      for (var i:int = 0 ; i < numberOfChildren ; i++) {
                           currentImg = imgData.image[i].imgURL;
                           imgLoader = new Loader;
                           imgLoader.load(new URLRequest(currentImg));
                           imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, placePics);
              function placePics(e:Event):void {
                     var oldH:Number = e.target.loader.height;
                     var oldW:Number = e.target.loader.width;
                     e.target.loader.height = 100;
                     var prosent:Number = (e.target.loader.height / oldH) * 100;
                     e.target.loader.width = (prosent * oldW) /100;
                     imgContainer.push(e.target.loader);
                     imgContainer[currentImgNum].x = (e.target.loader.width * currentImgNum) + (currentImgNum * 5) + 6;
                     addChild(imgContainer[currentImgNum]);
                     currentImgNum++;

    Never mind! I finally managed to see what to do. Thanks for the help
    package {
         import flash.display.*;
         import flash.events.*;
         import flash.net.*;
         public class thumbHolder extends MovieClip {
              var xmlRequest:URLRequest;
              var xmlLoader:URLLoader;
              var imgData:XML;
              var numberOfChildren:Number;
              var currentImgNum:Number;
              var imgLoader:Loader;
              var imgContainer:Array = [];
              var currentImg:String;
              public function thumbHolder() {
                   currentImgNum = 0;
                   xmlRequest = new URLRequest("images.xml");
                   xmlLoader = new URLLoader(xmlRequest);
                   xmlLoader.addEventListener(Event.COMPLETE, handlePics);
              public function handlePics(e:Event):void {
                   imgData = new XML(e.target.data);
                   numberOfChildren = imgData.*.length();
                   adToArray(currentImgNum);
              private function adToArray(currNum:Number):void {
                   currentImg = imgData.image[currNum].imgURL;
                   imgLoader = new Loader;
                   imgLoader.load(new URLRequest(currentImg));
                   imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, placePics);
              function placePics(e:Event):void {
                   var oldH:Number = e.target.loader.height;
                   var oldW:Number = e.target.loader.width;
                   e.target.loader.height = 100;
                   var prosent:Number = (e.target.loader.height / oldH) * 100;
                   e.target.loader.width = (prosent * oldW) /100;
                   imgContainer.push(e.target.loader);
                   imgContainer[currentImgNum].x = (e.target.loader.width * currentImgNum) + (currentImgNum * 5) + 6;
                   addChild(imgContainer[currentImgNum]);
                   if (currentImgNum < numberOfChildren) {
                        currentImgNum++;
                        adToArray(currentImgNum);

  • Can I sort my photos to a different order than by date of creation?

    I want to sort my photos differently on ipad than date of creation.

    http://support.apple.com/kb/HT4221

  • SQL Loader Excel input file in different order than table

    Hi,
    Have an instance where I have an Excel spreadsheet we've used for a while got a field added to it. This field has been added as the fourth field. On my Oracle table, I added a column and its listed last. So of course when I import, the fields are out of order. Does any one know what can be done to fix this? I'm a newby at this, and couldn't find the answer already listed, so any help is appreciated.
    Thanks,
    Vic

    Hello Victoria.
    Please provide actual or sample statements and the full text of errors along with error code to help the forum members help you better. In this case, the DDL for the table, a couple lines of the data and the control file being used would be extremely helpful. Please enclose in { code } with no spaces so that the spacing is retained in the postas in  this   exampleThanks,
    Luke

  • Order by in select  statement doubt

    Hi ,
    i created one table tab name is one column
    tab
    name
    5
    4
    11
    1
    2
    a
    b
    aa
    select * from tab order by name;
    and i got the result like this
    name
    1
    11
    2
    4
    5
    a
    aa
    b
    but i want to sort numbers as numeric order and name as alphabatic order
    means like order below
    name
    1
    2
    4
    5
    11
    a
    aa
    b
    how can do in a single oracle query can anyone help me .
    with regards

    One method..
    SQL> select c1
      2  from test
      3  order by decode(translate(c1,'a0123456789','a'),
      4                   null,to_number(c1),null) nulls last,
      5           c1
      6  /
    C1
    1
    2
    11
    1b
    a
    a1
    b
    7 rows selected.
    Message was edited by:
            jeneesh
    No need of TRIM.Thanks Rob...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • VOB converted to AVI audio files imported to premiere play in different order than the video files

    Hello there,
    I extracted the VOB files from a burned dvd created with Adobe Premiere pro 1.5, I converted the files into AVI files, then I imported it to Premiere CS4. The video sequence on the timeline plays in the correct order but a very fast speed, and the audio sequence plays all the individual clips in a random order, not in the order that they were originally edited in.
    What did I do wrong while importing or converting?
    Elio38

    Hi Elio,
    What program, or utility did you use to convert the .vob files to .avi, and what was your target codec?  I typically use SUPER Converter, which is free and very versatile, to convert program stream .vob files to a useable format that PPCS4 is compatible with. You can also directly import and edit a .vob file from a DVD in PPCS4 by simply changing the file extension to .mpg. However, doing so will eliminate the audio channel from the video clip in PPCS4.
    I was able to recreate what I believe was your issue when I tried converting a .vob file to an .avi file, regardless of what codec I used.  I had no issues what so ever when converting the .vob file to a .mov file using the DV codec, for example.  It could be a bug with PPCS4 because the same .avi file I created with the DV codec played back fine in WMPlayer, and VLC, but played back almost in slow motion in PPCS4.  It might be advantageous for you in the meantime to re-convert the .vob files to .mov files and just choose the standard DV codec.
    Remember, you are trying to edit files that are intended for delivery and that were not originally designed to be edited.  Attempting to edit inter-frame formats such as MPEG-2, MPEG-4, FLV, etc...has caused many a headache and even today, are not the easiest to work with.

  • Front Row shows Aperture projects in different order than Aperture does

    I have a bunch of projects, carefully organized in such a way that I can find them easily. Front Row just seems to display them ordered randomly.
    Anyone aware of a fix for this?

    Johnathan Burger wrote:
    2) Did you add track #'s?
    Yeah. I made 5 short videos, and set then as "1 of 5" "2 of 5" etc.
    I can't understand why it's out of order in Front Row.
    As for question 1, the weird thing is when the genre was set to "documentary and drama" it was in TV Shows on Front Row, but when I changed it to just "drama" now it's in the movie section... weird, but that's fixed now.

  • My paint bucket is filling with a different color than I selected

    Please help! All of a sudden my paint bucket is filling with odd colors......tried opening and closing program but it doesn't work. Thanks in advance.....I have Adobe Photoshop CS.

    I'd check the blend mode and opacity settings set in the tool options bar with the paint bucket tool selected.
    Most likely you want it set to Normal and 100%
    Or right click on the Paint Bucket Tool icon in the tool options bar and choose Reset Tool.

  • How to print Checks in certain order than by Vendor Numbers?

    We need to print certain batch of checks in different order than SAP standard(Vendor Number), is there anyway to make SAP to print them in different order?
    Thanks in advance for the assistance.
    Points will be awarded.

    hi Frank,
    Banking>Outgoing Payments>Checks for Payment . From that window you can access the print layout for checks and customise it to suit your requirements.
    or,
    If you are using SBO 2005, I would recommend going to Banking > Document Printing... See help details as pasted below.
    Prerequisites
    The following definitions are set:
    · The required parameters in Administration > System Initialization > Print Preferences >Per Document tab >Checks for Payment option
    · The print-related parameters for each house bank account in Administration > Setup >Banking >House Bank Accounts.
    Procedure
    1. Choose Banking >Document Printing.
    The Document Printing – Selection Criteria window appears.
    2. In the Document Type field, select Checks for Payment. Enter all other parameters and choose OK.
    The Print Checks for Payment window appears.
    3. All checks are selected by default. Deselect checks that you do not want to print.
    4. Ensure that the Next Check No. is correct. Change it if necessary.
    5. Load the printer with the correct check pages or blank paper. Then choose Print.
    The Check Number Confirmation window appears.
    6. Collect the printed checks from the printer and compare them to the checks displayed in the window.
    7. If the numbers assigned by SAP Business One do not match the printed checks, you can change them. Correct the number of the first check and press TAB. The following check numbers are updated accordingly.
    Only checks with successive numbers issued by the same account will be updated accordingly. For example, if you change the check number from 999 to 2000, check numbers 1000, 1001, 1002 and so on will be updated to 2001, 2002 and 2003.
    If the check numbers are not successive, you must correct each one of them manually.
    8. By default, the status of all checks in the window is confirmed. Change the status if necessary.
    9. Choose Update or OK.
    Result
    The numbers assigned to confirmed checks are marked as used.
    The Next Check No. field in the House Bank Accounts – Setup window is updated.
    Check numbers used for overflow printing are marked as voided.
    Checks with the Unconfirmed status are marked as printed, but the numbers assigned to them are not marked as used.
    hope this helps u.
    cheers,
    Hema.

  • Index not being used in Select statement

    Friends
    I have the following SQL statement:
    SELECT
    a.acct,
    a.date_field,
    UPPER(b.feegroup) feegrp,
    SUM (a.fee1) fee1,
    SUM (a.fee2) fee2,
    SUM (a.fee3) fee3
    FROM table1 a, table2 b
    WHERE 1 = 1
    AND a.fee_id = b.fee_id
    GROUP BY a.acct, a.date_field, b.feegroup;
    Both the tables have index on fee_id column. When I run the explain plan for this statement, I am getting the following output:
    Operation | Option | Object Name | Position
    SELECT STATEMENT | | | 560299
    HASH | GROUP BY| |1
    TABLE ACCESS | FULL| table2 | 1
    TABLE ACCESS | FULL| table1 | 2
    Why Oracle is not using the index?
    Edited by: darshilm on Dec 10, 2009 3:56 PM

    The proposed plan is the optimal according to your current conditions in the "where clause" where you have only the equality join condition and therefore the CBO can use HASH JOIN. Using any kind of index access would just increase the amount of required work unless you would add some very restrictive conditions which will select rows from relatively small amount of blocks. Here I have to mention that what really counts in the CBO cost calculation is the amount of blocks accessed and not the number of rows. The "currency" for I/O in Oracle is a block and not a row. CBO always uses an assumption that there is nothing in the buffer cache and it will have to perform a physical read for every block.
    How many blocks will actually be accessed depends on the data distribution. It can happen that every single row that you have to retrieve resides in a different block and although you access only 1000 rows out of a million row table you would have to visit almost every block of that table. For such a situation a FULL TABLE SCAN is the best access path and Oracle will use multiblock I/O for that. On the other side you can have those 1000 rows only in a few blocks and then the index access would be the most appropriate one. For index access Oracle uses single block I/O. Usually the actual situation is somewhere between this two extreme situations. But you can run some tests by yourself and see when an index access will be replaced by a full table scan while you will make your predicates less selective.
    HTH, Joze
    Co-author of the forthcoming book "Expert Oracle Practices"
    http://www.apress.com/book/view/9781430226680
    Oracle related blog: http://joze-senegacnik.blogspot.com/
    Blog about flying: http://jsenegacnik.blogspot.com/
    Blog about Building Ovens, Baking and Cooking: http://senegacnik.blogspot.com

  • Diffrent options of select statement...

    What are the different options for the select statement...If you could provide code samples that will be helpful...
    Thanks
    Jim

    hi
    <b>
    SELECT statements
    Reading Single Entries</b>
        e.g. Select single * from customers
    <b>Getting statistical information using max, min, avg, sum</b>
    <b>Reading each line using Select ….. EndSelect</b>
           e.g.      Select * from Customers.
                  Write :/ Customers-name
                EndSelect
    <b>Reading all the table entries using Select .</b>
            e.g. Select * from Customers into table all_Customers
    <b>FROM variants</b>
    FROM <dbtabname>                                          
    ... FROM <tabref1> [INNER] JOIN <tabref2> ON <cond>           
    ... FROM <tabref1> LEFT [OUTER] JOIN  <tabref2> ON <cond>           
    <b>SELECT INTO variants</b>
    INTO <wa>                                                    
    ... INTO CORRESPONDING FIELDS OF <wa>                            
    ... INTO (f1, ..., fn)                                         
    ... INTO TABLE <itab>                                            
    ... INTO CORRESPONDING FIELDS OF TABLE <itab>                    
    ... APPENDING TABLE <itab>                                       
    ... APPENDING CORRESPONDING FIELDS OF TABLE <itab>
    <b>
    SELECT – Loop function</b>
    On change of
         SELECT * FROM T100
              WHERE SPRSL = SY-LANGU
              AND MSGNR < '010'
                  ORDER BY PRIMARY KEY.                          
              ON CHANGE OF T100-ARBGB.                                        
                        ULINE.                                                        
                    WRITE: / '**', T100-ARBGB, '**'.                            
              ENDON.                                                          
              WRITE: / T100-MSGNR, T100-TEXT.                                 
         ENDSELECT.
    regards
    ravish
    <b>reward points if helpful</b>

  • Use of wildcard * in SELECT statement

    I have read that the use of the wildcard * in a SELECT statement cannot be utilized when using the INSERT INTO or other queries where data column/field alignment is critical. I have noted that the INSERT INTO column/fields must be in the same order
    as the SELECT statement (as there is no alignment to column/field names). Can someone please provide me with the information or article that covered this scenario?

    It is consider a good practice to specify columns name, however , SQL Server is smart enough to insert the data without too , but only if the table does not have an IDENTITY property
    CREATE TABLE #t (c1 int, c2 char(1),c3 real, c4 bit)
    CREATE TABLE #t1 (c1 int, c2 char(1),c3 real, c4 bit)
    ---Same thing with INSERT  like SELECT * you asked
    INSERT INTO #t1 VALUES (1,'A',2.5,0) 
    INSERT INTO #t1 VALUES (2,'B',3.5,1)
    INSERT INTO #t1 VALUES (3,'C',4.5,0)
    INSERT INTO #t SELECT * FROM #t1
    SELECT * FROM #t
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Restricting records in the select statement

    Hi,
    I have one requirement where in i need to restrict my select statement to get only 250 records in the output table.
    Here are the select statements i am using....
        SELECT a~ebeln
                     a~lifnr
                     a~ekgrp
                     b~werks
                     b~matnr
               FROM ekko AS a INNER JOIN ekpo AS b
               ON aebeln = bebeln
               INTO TABLE i_ekko
               WHERE a~ebeln IN r_ebeln AND
                            a~lifnr IN r_lifnr AND
                            a~ekgrp IN r_ekgrp AND
                            b~werks IN r_ewerk AND
                            b~matnr IN r_matnr AND
                            a~bstyp = 'F'.
                IF NOT i_ekko[] IS INITIAL.
    Select Vendor name
               SELECT lifnr
                            name1
                      FROM lfa1
                      INTO TABLE i_lfa1
                      FOR ALL ENTRIES IN i_ekko
                      WHERE lifnr = i_ekko-lifnr.      
    Here if i restrict the first select statement to get only 250 records then i am not getting the desired record in the second select statement.
    Could anyone let me know how to write the select statement.
    Regards,
    Ramesh

    restric the first select using up to 250.
    sort the i_ekko by vendor name.
    ex: sort i_ekko by lifnr.
    use second select statement here.

Maybe you are looking for

  • Query Updation recovery in Oracle

    Is there any way I can track changes made to the database timewise. I modified a column value from front end by mistake. It actually toggles the column value in the table from 'Y' to 'N' or vice versa upon clicking it. Im not sure how many times I to

  • Script for export in datapump  -- help needed !!!

    hello all, i am using the following script as batch file in my database for export script: ========= exp name/password file=d:\exp\%date%.dmp full=y log=d:\exp\exp.log an this will replace the first file(monday) on next monday. similar way i need a s

  • New memory leak with CS4 update?

    I just downloaded the CS4 update last night, and was doing my normal photoshop work when I had to re-start the application due to what looks like a memory leak. Windows XP, 3GHZ dual core ( 45 nm one ), 4 GB RAM, NVidia 9600 GT, no GPU enabled ( stil

  • Handling Outer Join for hard coded values in the Logical Table Source

    Has anyone tried to apply an outer join in the Logical Table Source Content Tab? I have to add this APPLSYS.FND_LOOKUP_VALUES.LANGUAGE (+)= 'US' but the outer join is not allowed. I get this message.... [nQSError: 27002] Near <(>: Syntax error [nQSEr

  • PSD files open sized at .148

    I've used Photoshop since 1994 and I've never seen this:  when I open an existing file in PS4, it now opens at the tiniest possible display size, i.e., .148 percent.  I have to go up to the transport bar and use the pull down menu to enlarge it to a