ORDER BY using for the column that is not in a select list of selection?

Hi all.

I have a selection list on an APEX at the apex.oracle.com page, and I would like to order by the value of the UnitOrder column.
The SQL is:
SELECT DISTINCT foodunit.name AS display_value, foodunit.foodunitid AS return_value
FROM foodunit, food
WHERE foodunit.foodid = :P18_FOODID
ORDER BY foodunit.unitorder ASC;
Of course, this code does not work. And since it's a selection list, I can't just add foodunit.unitorder to the SELECT statement. In addition, I can not get rid of the SEPARATE, because then for some reason, it tends to view an infinite amount of the same line...
Order by UnitOrder is that all units that start with gram, mg, ml, kg,... etc., will be shown on top of the selection list. All other units of food will be shown on the second place and so on.
The UnitOrder column contains 1 or 2 as the value. 1 is the value for all lines which should be displayed at the top of the list of selection, 2 is the value for the rest.

So, what I want, it's all the lines in which the UnitOrder is 1, are displayed on top of the selection list. Usually only 2 list items get displayed in the list of selection at a time, depending on what food item a user has selected. The selection list is then refined to certain lines that match the foodid etc etc...

If someone has an idea, I would be very happy to hear about it.

I don't see a join between the tables of your foodunit and food. That would solve your problem of "endless amount"?

(you can omit the food table of your selection)

Tags: Database

Similar Questions

  • The column that does not match when comparing two records

    Hi all

    We try to compare two tables and find the differences. So if two records (1 of each table) have same PK but not always matching because of some columns, then we would display this columnname. For example:

    Table 1

    PK Parent Child Property1 Property2
    1AA1P1PR1
    2BB1P2oraPR2
    3CC1P3SRP

    Table 2

    PK Parent Child Property1 Property2
    1AA1P1PR1
    2BB1P2PR2
    3CC1P3PR4

    In the above example when I compare 2 tables all matches except Property2 online n ° 3. Thus, we would like to get an output like:

    PK Column_Mismatch
    3Property2 (this must be the name of the column that does not match)

    Appreciate the help.

    Thank you

    Andy

    Hi, Andy.

    Andy1484 wrote:

    Hi all

    We try to compare two tables and find the differences. So if two records (1 of each table) have same PK but not always matching because of some columns, then we would display this columnname. For example:

    Table 1

    PK Parent Child Property1 Property2
    1 A A1 P1 PR1
    2 B B1 P2 oraPR2
    3 C C1 P3 PR3

    Table 2

    PK Parent Child Property1 Property2
    1 A A1 P1 PR1
    2 B B1 P2 PR2
    3 C C1 P3 PR4

    In the above example when I compare 2 tables all matches except Property2 online n ° 3. Thus, we would like to get an output like:

    PK Column_Mismatch
    3 Property2 (this must be the name of the column that does not match)

    Appreciate the help.

    Thank you

    Andy

    Why you don't want no matter what exit for pk = 2?  Property2 does not correspond either to pk.

    What happens if the 2 columns (or more) do not match?  The following query would produce a list delimited, such as ' parents; PROPERTY2 '.

    WITH got_mismatch AS

    (

    SELECT pk

    , CASE WHEN t1.parent <> t2.parent THEN '; PARENT' END

    || CASE WHEN t1.child <> t2.child THEN '; CHILD ' END

    || CASE WHEN t1.properry1 <> t2.property1 THEN '; PROPERTY1 ' END

    || CASE WHEN t1.properry2 <> t2.property2 THEN '; PROPERTY2 ' END

    AS the offset

    FROM table_1 t1

    JOIN table_2 t2 ON t2.pk = t1.pk

    )

    SELECT pk

    , SUBSTR (incompatibility, 3) AS column_mismatch

    OF got_mismatch

    WHERE mismatch IS NOT NULL

    ;

    If you would care to post CREATE TABLE and INSERT statements for your sample data, and then I could test this.

    The query above does not count NULL values as inadequate.  If you want that, the same basic approach will work, but you can use DECODE instead of <> to compare columns.

    What happens if a pk exist in a table, but not the other?  You want an outer join, where I used an inner join above.

  • Right-click on the graph that is not possible to select «visible items»

    Hello

    I have a problem with a graphic. I use the same type of chart in two different projects.

    But only in a single project, I can right click on the graph that shows a popup to 'the visible elements' where I can show/hide legend cursor for example.

    Is there a mode that prevents right-clicking on the graph?

    I can only change visible elements when the program is stopped and not while it is running.

    Thanks for help

    Or maybe you have unchecked the "allow default run-time contextual menus" in the appearance of window customize?

  • I downloaded version 5.7 of Lightroom in order to support the captive capture on my Nikon D750 and its still does not. More when I was invited to give my serial number for the update that was not the case that are on my Adobe profile, although I purchas

    I downloaded version 5.7 of Lightroom in order to support the captive capture on my Nikon D750 and its still does not. More when I was not invited to give my serial number for update is no where on my Adobe profile, although I bought and pays every month for my creative cloud for photography. Help, please

    Your subscription to cloud shows correctly on your account page?

    If you have more than one email, you will be sure that you use the right Adobe ID?

    https://www.adobe.com/account.html for subscriptions on your page from Adobe

    If Yes

    Some general information for a subscription of cloud

    Cloud programs don't use serial... numbers you, connect you to your cloud account paying to download & install & activate... you may need to sign out of the cloud and restart your computer and log into the cloud for things to work

    Sign out of your account of cloud... Restart your computer... Connect to your paid account of cloud

    -Connect using http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html

    -http://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html

    -http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html

    -http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html

    -ID help https://helpx.adobe.com/contact.html?step=ZNA_id-signing_stillNeedHelp

    -http://helpx.adobe.com/creative-cloud/kb/license-this-software.html

    If no

    This is an open forum, Adobe support... you need Adobe personnel to help

    Adobe contact information - http://helpx.adobe.com/contact.html

    -Select your product and what you need help with

    -Click on the blue box "still need help? Contact us. "

  • font used for the hidden components is not rendered

    Hello

    I developed a form using components (button and list), that form is hidden, and all fonts used by my components are not displayed.
    When you remove the mask, the titles of the component are displayiing correctly.

    How can I make the font of my components when hidden?

    Is there a trick?

    Thank you

    I found the solution:
    the form is contained in an element called "clip", I simply had set cacheAsBitmap to true:
    clip.cacheAsBitmap = true;

  • Number of messages for the Adobe Forum do not match current messages list

    I'm confused by how this forum is set up. When you click home, you see a list of all categories of the forum with the number of topics displayed in each of them. Some of them have only a few hundred, others have thousands. However, when you click on the title of the forum look at some of these subjects, he mentions only a few topics, and when I search on my problem, he does not seem to be looking to archive full of hundreds or even thousands of topics. (There must be some topics with the word "XPJ" in them out of these thousands, but none go into research.)

    The forum includes only the topics in the years underway, and counts on the home page are simply not up-to-date? If so, how can I see the subjects of previous years?

    I appreciate all help. Otherwise, I will have to post a new topic on something that people have probably already discussed last year, and I can't wait to do without it first searches. :(

    Thank you
    Lisa

    Hi Rick,

    I found it! Thank you very much!

    If someone else needs to find it, here are the specific steps:
    1. click on profile.
    2. click on personal Options on the next page that appears.
    3. change the number in the return of days to view topics for field.

    (Mine has been set at 20. No wonder I wasn't see results! I don't know what is the max, but I managed to change to 365).

    A big thank you once again, Rick!
    Lisa

  • How to create the presentation for the columns variable and use it in the story?

    Hi all

    Someone knows how to create variable presentation for a column (that is, I need to create it in edit section formula itself). And then, I should use it in the Narrative section to display the value of this column. Is this possible? Or do I need to use any other variable for this requirement? If Yes please let me know, how to create it? This is a very urgent requirement.

    Thanks in advance
    Stephanie

    Hello
    You can have any number of columns in the narrative view, he will accept... Just mention the numbers of the columns in the view body narrative...

    check if useful/correct...

    Thank you
    prassu

  • Order is created for the anonymous user without persistence of profile

    Hi all

    Could you please specify o how to implement below scenario

    Order is created for the anonymous user without persistence of the profile using cookies. So that when the user visits the site next time we can load

    order/cart previous from browser cookies.

    Yes, you can do that, the orders can be persisted without persistence of profile, but persistence of anonymous orders will increase the number of orders in the table quickly and can have an impact on performance, so if you plan to do it this way then make sure that your AbandonOrderScheduler job is running to clean up orders.

  • The user can only download the columns that I choose?

    Hey, guys:

    Is that possible I put somewhere in the APEX so that the user can download only the columns that I choose instead of all the columns in the report, that this user can see, like some columns of links that directs the detailed individual pages? It makes no sense for the user to see these columns in a CSV file.

    Thank you.

    Sam

    Published by: lxiscas on May 20, 2013 14:24

    Published by: lxiscas on May 20, 2013 14:26

    lxiscas wrote:

    Is that possible I put somewhere in the APEX so that the user can download only the columns that I choose instead of all the columns in the report, that this user can see, like some columns of links that directs the detailed individual pages? It makes no sense for the user to see these columns in a CSV file.

    For standard reports, use the property to include export in the column definition.

    To view interactive reports + {message identifier: = 10556630} +.

    * When it comes to 'reports' always make it clear if you use a standard or interactive report.

  • How do the display column that is not in the subject box.

    Hi all

    I have a requirement to report where I show a column that is not discipline.
    for example, obligation to report is like where I need the columns from 2 different subjects.
    1 in. and part 2 of the Bill.
    now, I have linked IN. details of invoice discipline, but one column is missing.
    Rite now I m capture this column related details report separate and I'm passing values to the main report.
    But what happens if I want to display this column in the main report.
    Please let me know your inputs...
    Thanks in advance...

    You can do it in 10g using the Advanced tab in the answers. Scroll to the part of the link that says, "against the two domains (multiple domains)."

    http://gerardnico.com/wiki/dat/OBIEE/multiple_subject_area

  • How can I get Firefox looking for my computer for the plugins that are already there?

    How can I get Firefox looking for my computer for the plugins that are already there?

    Adobe Flash player is already on my computer from IE 8. How can I get Firefox to see that it is already on my PC and use it so I don't have to download it again and possibly create other problems. Also, in my efforts to download Flash, active Firefox IE that made me concerned that would cause problems that our just leave me where I am now, instance where IE can use a bottle but Firefox cannot.

    Internet Explorer uses a version of the Flash player ActiveX plugin as it does not work with other browsers.

    Download the version of the https://www.adobe.com/products/flashplayer/distribution3.html Plugin-based browsers and make sure Firefox is closed when you install it.

  • My iTunes playlist display has changed and I can't control the columns that appears? My old playlists are very good.

    OK, I make playlists for radio broadcast. I need to change the columns shown, and it has always been easy. The playlist I created just has a different view, and there seems to be no way for me to change the columns that are visible. Any ideas?

    Click Show main menu, and then click Show the Options. You can select the columns that you want or do not want to here.

    See you soon,.

    GB

  • my c drive shows low disk space, so I searched for the program that holds more memory on drive c. I got to know that this pagefile.sys has 3 GB in the c drive

    Hi, my c drive shows low disk space, so I searched for the program that holds more memory on the c drive. I came to know that pagefile.sys has 3 GB in the c drive, kindly guide me to move the pagefile.sys to another drive.

    Hi jafrin.michel,

    Thanks for posting in the Microsoft community.

    Before you start the troubleshooting steps, I need the information required.

    What version of the windows operating system do you use?

    Method 1:

    If you are using windows 7, I suggest to perform a disk cleanup and verify.

    Delete files using disk cleanup

    http://Windows.Microsoft.com/en-us/Windows7/delete-files-using-disk-cleanup

    Method 2:

    If you want to move the pagefile.sys to another drive, follow the steps and check out them.

    Follow these steps to move the pagefile.sys to C: drive on D: drive (if you have the drive D :).

    1, write click on my computer and select Properties.

    2, click on the Advanced tab.

    3, click settings under performance menu.

    4, click on the Advanced tab and click on change.

    5, select letter (C :) and "BOLD" No pagefile then click on Set. )

    6, if you want to configure pagefile.sys in, select drive D: drive letter D: and "BOLD" in the custom size or the size of the system managed , then click on Set. It displays a pop-up message click OK.

    7, again click apply and OK OK.

    8, the system you will be asked to reboot, click on Yes.

    9, after rebooting the system, you can see the pagefile.sys will be moved to D:

  • Which card to use for the backup of Win8

    Windows 8 requires a minimum of 32 GB card to use for the backup. I bought a PNY 32 GB (http://www3.pny.com/32GB-Pro-Elite-Series-Hi-Speed-SDHC-Class-10-UHS-1---35MBs-233X-P3122C442.aspx ), but it wouldn't work. Even though it says 32 GB it is actually a little less. If I buy a 32 GB SanDisk will, that I meet the same problem? Exactly what the size is a SanDisk 32 GB card? (http://www.sandisk.com/products/memory-cards/sd/standard-class4/?capacity=32GB)

    Thank you

    Ed P2

    any card 32 GB will be less than 32GB after it is formatted to be used in a computer. It is a standard for all types of storage.

    If you need 32 GB of actual useful storage space, you will have to get a 64 GB card.

  • Windows Media Player - change the columns that appear under 'Now Playing'

    I would like to change the columns displayed in the views now play and Windows Media Player play list.  The factory default is to show only the fields title and length.  It wouldn't be that big a deal this is something fairly simple to access the page layout options, hit choose columns and select the check boxes for the columns I want to show... but the title and duration are the only fields that it allows me to select from.  He still refuses to allow me to select anything else.  I know that there is a way to display more information, but for the life of me I don't remember how to do so that he can do.  Help?

    Hey,.

    I've recreated the scenario on my Windows Media Player. It shows all the info like length, side, title, album, artist to contribute. Appoint you.

    Scan SFC should be your friend.

    http://support.Microsoft.com/kb/929833/en-us

Maybe you are looking for

  • What happens to my backup?

    When I plug my iphone to the computer, itunes was always and always back up automatically. I noticed that whenever synchronize itunes, it removes the old backup. Lets say I had a backup on July 3, which is so important for me, but today on 7 July, wh

  • First HP: Determinant of n * n matrix

  • PhotoSmart D110: Scan failure, failure of HP Solutions Center

    Well, I just moved to a new Lenovo PC Dell 6 years. The two are running win 10 64 with automatic updates. On the Lenovo printer funtion works fine, but I'm unable to scan. On the side of things, it seems that the HP Solutions Center is no longer inst

  • Adapter WiFi does not see my link ap?

    Hi, I have HP ProBook 4530 s and I stand bad upgrad Windows 8 so work net adapter see all wifi network round accept my access point! so I don't know what to do and I am looking for driver for windows 8 and found nothing! My adapter is realtek

  • Validation code: 0x8004FE21

    Separated from this thread. I seem to have the same problem as you. Did you use the intel driver update utility (found nothing for me) or do you need to manually install the drivers? You have a link that you can send me? I made a kind of updated abou