Give priority to my data

Oracle version: Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production of =

Hi gurus

Need your help once again... I have the sample data...

Examples of data

create the table prior_class

(

Pl_id varchar2 (5).

class_id varchar2 (10)

);

insert into prior_class

(

Select Pl_id '001', 'A1' double class_id

);

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

Select * from

(

with RID as

(

Select '111' pl_id, '100' as grp_nbr, '1' class_id, 'class A' as class_desc, 27' as any double union chose_from

Select ' 112 ', ' 100', ' 1 ', 'class AA', ' 28 "of any double union

Select ' 113 ', ' 100', ' 1 ', 'class BB', ' 29 "of any double union

' Select ' 114 ', ' 200',' 2 ', 'class XX', '26' double Union

' Select ' 001 ', ' 200',' 2 ', 'class CC',' 26' double

)

Select rid.*,

ROW_NUMBER () OVER (PARTITION BY grp_nbr, class_id)

ORDER OF CASES

WHEN chose_from = 29

AND class_desc IS NOT NULL

THEN 1

WHEN chose_from = 27

THEN 2

3. OTHER

END

) AS r_num

to rid

)

-where r_num = 1

;

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

My query result

class_id class_desc chose_from r_num grp_nbr pl_id

1131001Aclass BB291
1111001Aclass A272
1121001Aclass AA283
0012002Aclass CC261
1142002Aclass CC262

I need simple line by grp_nbr so I give priority to my data using the column chose_from and cause in my order by clause of my analytical function.

Now I still have to give priority to my data by using the following rule.

Rule

If there are several class_desc exist against same grp and lb = 26 system check can rid. Pl_id of prior_class of the table, and if this pl_id exists in the table can get these data for this and assign r_num = 1 against him or return thereof.

My output required

1131001Aclass BB291
0012002Aclass CC261

Thanks in advance...

Is that what you want:

WITH RID AS

(

SELECT '111' pl_id, '100' AS grp_nbr, 1A ' ' AS class_id, 'class A' AS class_desc, 27' AS chose_from FROM dual UNION ALL

SELECT ' 112 ', ' 100', ' 1 ', 'class AA', ' 28 "FROM dual UNION ALL

SELECT ' 113 ', ' 100', ' 1 ', 'class BB', ' 29 "FROM dual UNION ALL

"' SELECT ' 114 ', ' 200',' 2 ', ' class XX ', 26' FROM dual UNION ALL '.

' SELECT ' 001 ', ' 200',' 2 ', 'class CC',' 26' DOUBLE

)

SELECT *.

DE)

SELECT rid.*,

ROW_NUMBER () OVER (PARTITION BY grp_nbr, class_id)

ORDER OF CASES

WHEN chose_from = 26 AND EXISTS (SELECT 1 FROM prior_class WHERE PRIOR_CLASS.PL_ID = rid.pl_id)

THEN 1

WHEN chose_from = 29

AND class_desc IS NOT NULL

THEN 2

WHEN chose_from = 27

THEN 3

4 SOMETHING ELSE

END

) AS r_num

TO RID

)

WHERE r_num = 1

Tags: Database

Similar Questions

  • ESW 520 give priority to IP addresses

    I have a LAN with IP addresses for the computers and public, static IP for VoIP phones. They are a hosted VoIP provider, and I want to give priority to the public IPs from my ESW-520-48 per switch How I implemented that in this switch?

    I have no roles assigned on ports and no configuration of VLAN either. I had tried to separate the VLAN first, but eliminated this way. It is once again all VLAN 1 now on the switch. For some reason when I put in place of the 100 VLAN for voice, the voice stopped working on phones, but data were always very good.

    Hi netguy,.

    QOS in rewriting the DSCP (dissociated Services Code Point) address IP phone range by;

    1. create an ACL that specifies the range of IP addresses with mask reverse

    2. attach the ACL on a map of advanced class, then

    3. fix a plan of class to a table of QOS policy that is configured to set a new DSCP value

    4. attach a QOS policy on an interface

    5 but you have a default Advanced QOS configuration already in place, so that should be modified or deleted.

    It is difficult if you have never played with before advanced QOS or understand the latest five statements.

    I guess that your hosted IP phones have DSCP settings (dissociated Services Code Point) already placed on IP phones or the settings that you can set directly on each IP phone?

    If it is possible, why not just move the switch to the basic QOS mode and then say the switch to trust DSCP.

    Well, it's the best thing to do.

    Best regards, Dave

  • How could I give priority to my network connections, (without turning off the strap attached, as it took), so that it uses the internet from my main network connection?

    Prioritize network connections

    OK, here's the situation.
    I have a regular ethernet connection that provides me with a network and the internet.
    I have also a tablet PC which I attach to my PC so I can use it as a controller. (Not that it is important, but it's for a DAW/Midi controller)

    My problem is that whenever I place my tablet, PC starts by ignoring my normal connection and taking the internet from my Tablet (even when it is not connected to the internet). As a result, my internet is de-energized once I tie it, if I'm not as under the wifi on my tablet.

    My question is, how could I give priority to my network connections, (without turning off the strap attached, as it took), so that it uses the internet from my main network connection?

    Hello

    As well as the troubleshooting provided by Boumediene steps, you can also try the steps in this link. Some screenshots are also available on the link for a better understanding.

    http://www.howtogeek.com/HOWTO/27994/how-to-change-the-priority-of-wiredwireless-network-cards-in-Windows/

    Hope you will find this is useful.

  • How to give priority to a task of counter

    Hello

    I'm sure that this issue has been discussed previously, but I wasn't sure how to phrase the question to find the previous discussions. We are a gated counting vi photon using a pair of 6229 cards. Generate us a portal with a meter and count the pulses of the MTP with the other counter.  We have a pretty old computer (which we are to date) and when trying to open files or other windows, the counter seems to lose the processor priority temporarily and the result is unreasonably high.

    Says "' is the basis of our experience, so we would like to know if there is a way to prioritize the tasks of meter or create a buffer that prevents this glitch windows related to our program. Any idea or even a link to a previous thread would be very helpful!

    Thank you!

    Hi Kate,.

    Thanks for the additional info - it seems that you have changed the instance of DAQmx Read samples N but still need to wire samples by the input to the Timing.vi DAQmx channel

    Using samples per channel is another way to set the size of buffer.  For finished tasks (which is the default value), the buffer size = samples per channel (unless otherwise stated).  Samples by default channel is 1000.  WIRING this should allow you to say exactly how many gates consecutive custom - regardless of the size of buffer, the task ends after the end of the samples by acquisitions from chanel to the task.

    Reading samples N will be much faster (just look for timeouts).  You can actually leave the number of samples per channel unwired on the DAQmx Read - the default is - 1, to read all the samples you want your finished job.

    Best regards

  • Give right to form data record, but no other right?

    I have a simple form. I want people to be able to save the form with the data, but I don't want to have other permissios as markup, comment, etc., or to add text - so save it under > PDF Reader extended options will not work because they give more to save form data.

    Is this possible and if so, how?

    -billb

    You first set the password security to prevent comment?

  • iPad IOS 9.3.4 (with GPS) air 2: using Skydemon (used for the flight) gives "Waiting for location data", as the error

    I use my iPad 2 a air application during the flight of an aircraft (Skydemon) for flight and my flight plan.

    Most of the time it works fine. Yesterday, I received an error "pending for location data. seems dat that GPS does not work correctly. I've recently implemented in the latest IOS update.

    Don't know

  • How can I deactivate heart rate monitor

    I want to register my pace heart health App via the data of my cup of BP... I don't want no other heart rate data.  How can I turn off the monitor watch heart where it generates no data in the application of health on my iPhone?

    Hello

    The health on iPhone app, you can reorganize your data sources, that changes the way that the application gives priority to their data.

    A data source which is placed above the other will have priority on all underlying sources that also contribute to the same type of data. Data are not double counted.

    More information and instructions for changing the order of sources:

    Manage the health data from multiple sources on your iPod touch, iPhone, or Apple Watch - Apple Support

    Also, on your iPhone, in the application of the watch, go to: My Watch (tab) > privacy > Motion & Fitness > heart rate. If you disable this setting, however, it will also disable the sensor for the fitness activity for the purposes of follow-up.

  • Deployment uses the local data store

    The deployment of VIO works without problem, but one of the virtual machines (VIO-DB-0) is now in a local data store. I never chose this data store in the installation process.

    Is it possible to manually move the virtual machine? Is it possible to define the data store used for the management of virtual machines somewhere?

    Concerning

    Daniel

    Hi Daniel,.

    Take a look at VMware integrated OpenStack 1.0 Release Notes:

    • Installer gives priority to local storage by default
      When you set up the data for the database stores three virtual machines, VMware OpenStack Setup integrated automatically gives priority to a local storage to improve IO performance. For resilience, users might prefer a shared storage, but the installer does not clear how to change this setting.
    • Workaround: Before completing the installation process, the installer of VMware OpenStack integrated allows you to examine and change the configuration. You can use this opportunity to change the configuration of the data to the database store three virtual machines.

    If you have already installed VIO, AFAIR you should be able to manually move between data warehouses as long as you do not change VM itself.

    Note that there is rule anti-affinite, so you may not be able to move that VM in the same data store when no other VIO - DB resides.

    Another note is that if you turn off VIO-DB-0, mysql service will not appear automatically. you have to turn on manually by running "service mysql start" on the node itself, or run 'vioconfig start' of the SGD server.

    Best regards

    Karol

  • Do the numbers tell me the last date of a cell containing specific text

    Hi guys,.

    I'm setting up a pilot logbook and I need to keep track of when I lead some approaches to the instruments for the purposes of recency.

    For example, the last time I did a VOR approach was April 20, 16.  I need the numbers to recognize the "VOR" text and give me the corresponding date.  I'm having numbers give me this date in a separate table.

    Any ideas on how to do this would be greatly appreciated.

    Thank you!

    Hi Walter,

    This is a roundabout way. Perhaps another user will display a more elegant way.

    Table 1 is a version abridged your journal of driving. Here is table 2:

    Table 2 uses the SIERREUR function to place "" (NULL) if the SEARCH fails to find a match between the value in the header line and an entry in the log of your flight.

    Otherwise, it inserts a value (The FIND returns the starting position of a string in another).

    Now we've found BK VOR (and fill to the right) and SID.

    Columns needed for approaches more more!

    Table 3 is a Date of any cell in table 2 which is not "" (NULL).

    Formula in A2 (and fill down and fill the right)

    = IF(Table 2::A2≠"",Table 1::$A2,"")

    You can type this than = IF (table 2::A2 <>"", Table 1: $A2, "")

    3 numbers will change <>≠

    Formula of the cell footer of table 3 (for column A, then fill to the right)

    = MAX (A)

    To improve the 'presentation', move (copy / paste) 2 Table to another worksheet (TAB). The formulas will adjust automatically.

    Happy flying!

    Kind regards

    Ian.

  • Why not given priority of a show of note sent anywhere in the grade received?

    In Thunderbird, you can set the priority of a mark composed and sent.
    However, I don't see any indication who give priority either the note which is sent in the sent folder or in the grade received. In particular, the recipient does not see the note as high priority and has therefore no indication that it is particularly urgent.

    It seems that the priority of Thunderbird feature is not operational.

    In a new window for the entry, you can set the priority of a message using:
    Options > priority > select an option for example. highest

    After sending, you can visualize this.
    Click on the "Sent" folder
    Click the "Select the columns to display" and select this option to display the column "priority." (you can set the "Priority" column in any folder)
    See image:

    In an email received you will see this in the source code and the full as headers:
    for example: X-Priority: 1 (high)

  • Why will not erase the working data.

    I have been a loyal Firefox user and have never had a problem until now. I've always used clear data to erase history. I know the procedure and how to do it. Recently it has stopped working. It allows to erase all data, as it is called. Now after that it gives me the "deleted data" signal, everything is still there. I tried to uninstall and reinstall Firefox, but it made no difference. What should I do? Thank you.

    This is the problem:

    Once to help clear the private data with history checked: when you go to the Home tab and slide to the story, all entries are still there?

    A user reported that this can be caused by activating the hidden settings in Android Developer. Here's where you who goes offshore:

    Android menu > settings > options developer

    Then uncheck the "do not keep activities."

    If this isn't the problem, could describe you more in detail?

  • Toshiba AT200 - date of last update Android release 4.0?

    Hello

    I bought a Toshiba AT200 United Kingdom tablet with honeycomb. Several sites Internet said that there will be an update to Android 4.0, while other rumors say otherwise... So can you confirm if we really want to have a honeycomb to 4.0 update? If so, can you give a rough release date?

    Thank you.

    > Then you can confirm...
    It is user to user forum created for customers and enthusiasts to share knowledge, solve problems and discuss technology (written above) and here, you will not find an official statement about this.

  • Documents and data with all the storage on iPhone

    A few days ago I tried to send an email with a large attachment. However, it has not been send so I deleted my account from my iPhone. Once I did, I got a message saying that almost all of my storage has been exhausted. I checked to see and I have about 5 GB of available 64 GB. I connected my iPhone to my computer to check which took all this space and 45 GB of my space is being taken up by the Documents and data. I deleted the old messages, imported pictures to my computer and erased, erase my history on safari, check on iCloud, and allows to remove most of my apps that I have read that the removing applications and later re - download. I've also updated to iOS 9.3. It helped very little. Documents and data is now only 43 GB instead of 45 GB. Before that happened, I got about 50 GB of free and now I just 5 GB free after it happened.

    What else can I do to clear more of Documents and data? Should I restore my iPhone to one of the backups that I recorded? Should I take my iPhone at the Apple Store because it happened so suddenly and randomly?

    On the phone, go to settings App > general > storage & use iCloud > manage storage (in STORAGE). Who will provide a list of what applications use data and in what quantity. Tapping on the app with you give the amount of data, the application contains (less himself) and in most cases the ability to delete the application, if you wish. You will not necessarily have to delete the app.

    Once you have completed all the actions, try a forced reboot: hold down the House and on the buttons until the unit turns off. Ignore the cursor off if it appears. Once completed, if it does not start on it own, turn off power with the key On. In some cases, it also contributes to double click the Home button and close all applications before restarting.

    Also, actually iTunes sync erases some of this possibility.

    One last thing, if you have installed whatsapp, there is a known problem cases that it runs in fairly large amount of data storage.

  • Average displacement Subvi does not refresh the data in time real host VI

    Hello!

    I time real host VI that has evaluate the NI 9215 cRIO block data 9073. He takes analog data and calculates the phase shift. It works well with the connected equipment and displays the results. I need to get the moving average value of phase shift, so I add moving average Subvi, where main VI entries - new value (phase shift measured) and ms and output - average value of travel time. When I run real time host VI it gives me a single data and stop get new data from Subvi. It refreshes not even values measured in real time. So the problem somewhere in the accommodation, with sub - VI. How it can be solved? How can I get real host VI with the moving average value of Subvi update running time?

    Thank you.

    Your problem is that you have a loop that runs until you press the Stop button inside your Subvi.  If you try to use a Global Variable that is functional, you have a few things wrong.

    1. the loop should run only once.  A TRUE to the conditional stay Terminal wire.

    2. the shift register cannot be initialized.  That is how he can keep the old elements in a story.  Use a first call? with a case structure so that you only initialize the table of history inside the loop on the first time the VI is called.

    But if you really want to make your life easier, just use the PtByPt.vi mean.  NOR did all the work for you.

  • Data channel read name DAQmx without installed DAQmx

    We have data files, including a header with the names of channels in the DAQmx channel name format.

    Now, we want to send a Labview application to our customer by which they can open these files and just seeing the names of channels in the form of text. Can we make such an application without requiring the customer to install DAQmx. We use Labview 7.1.1 and after installing the application, it asks for nivaiu.dll, nipalu.dll nipalut.dll and so on. Change the simple arrays of strings file header gives compatibility on old data problems.

    Concerning

    Dan Larsson

    Problem solved!

    Control of channel name DAQmx can serve as a binary file read model without installing DAQmx separately. I found a Subvi calling "DAQmx unflatten string. After the removal of this call everythings working.

    Sorry for all you mind!

    / Dan

Maybe you are looking for

  • Message error "arrested -"filter"has failed."

    After upgrading to Mac OS Sierra, when you attempt to send a test print my Epson Stylus Photo 2200, I get the message error "stop -"filter"failure" in my print queue. I have left clicked on the printer-> error log menu item, and I have the following

  • Temporary blocking frequent on Tecra M11

    I had two notebooks Tecra M11 - 17V. (the first was stolen and replaced by an identical)They both had the same problem where the machine would sometimes freeze for about 5-10 seconds. Frost occurs usually when you move the mouse over a button or a me

  • SuSE 9.2 on an A30 614

    I tried to install suse 9.2 on my laptop.It works if I stop the PCMCIA device on the manual installation. En I did.SUSE is working now but my pcmcia device does not work.When I see the irq pcmcia and lancart are on IRQ11.I need the device pcmcia for

  • What is the best 100% free updated driver software?

    I am a very old Windows xp home edition which requires 11 critical updates driver... If anyone has any suggestions I'd like to hear even if it has to be 100% free, downloading and recording

  • PC Companion changed language after upgrade

    I have a Xperia Z and PC Companion in Swedish. After upgrade PC Companion, the language has changed. It looks like the Turkish. Tried to uninstall and reinstall but the result is the same.