can I use partition with the following
Hi, I wanted to know if I can use or partition the row to the GET the necessary results below. If Yes can someone help me with it.If there is another way to get results as you please let me know.
I use Oracle 10.2.0.4.0 version
Create a table script:
CREATE TABLE DMM.QUES
(
CASENAME VARCHAR2(100 BYTE),
CASENUMBER VARCHAR2(20 BYTE),
COVERAGE VARCHAR2(10 BYTE),
DIVISIONNUMBER VARCHAR2(6 BYTE),
CLASSNUMBER number,
TIER VARCHAR2(2 BYTE),
MONTHLYRATE NUMBER
)
Insert manuscripts of the declaration:insert into QUES (CASENAME,CASENUMBER, COVERAGE, DIVISIONNUMBER, CLASSNUMBER, TIER,MONTHLYRATE)
values ('ABC','123J','health', '456J','987',null,.25)
insert into QUES (CASENAME,CASENUMBER, COVERAGE, DIVISIONNUMBER, CLASSNUMBER, TIER,MONTHLYRATE)
values ('ABC','123J','health', '456J','123',null,.25)
insert into QUES (CASENAME,CASENUMBER, COVERAGE, DIVISIONNUMBER, CLASSNUMBER, TIER,MONTHLYRATE)
values ('ABC','123J','health', '456J','453',null,.25)
insert into QUES (CASENAME,CASENUMBER, COVERAGE, DIVISIONNUMBER, CLASSNUMBER, TIER,MONTHLYRATE)
values ('ABC','123J','dental', '456J','453','ee',.29)
insert into QUES (CASENAME,CASENUMBER, COVERAGE, DIVISIONNUMBER, CLASSNUMBER, TIER,MONTHLYRATE)
values ('ABC','123J','dental', '456J','453','es',.23)
insert into QUES (CASENAME,CASENUMBER, COVERAGE, DIVISIONNUMBER, CLASSNUMBER, TIER,MONTHLYRATE)
values ('ABC','123J','dental', '456J','453','ec',.44)
insert into QUES (CASENAME,CASENUMBER, COVERAGE, DIVISIONNUMBER, CLASSNUMBER, TIER,MONTHLYRATE)
values ('ABC','123J','dental', '456J','453','fa',.33)
insert into QUES (CASENAME,CASENUMBER, COVERAGE, DIVISIONNUMBER, CLASSNUMBER, TIER,MONTHLYRATE)
values ('ABC','123J','dental', '456J','123','ee',.45)
insert into QUES (CASENAME,CASENUMBER, COVERAGE, DIVISIONNUMBER, CLASSNUMBER, TIER,MONTHLYRATE)
values ('ABC','123J','dental', '456J','123','es',.45)
insert into QUES (CASENAME,CASENUMBER, COVERAGE, DIVISIONNUMBER, CLASSNUMBER, TIER,MONTHLYRATE)
values ('ABC','123J','dental', '456J','123','ec',.46)
insert into QUES (CASENAME,CASENUMBER, COVERAGE, DIVISIONNUMBER, CLASSNUMBER, TIER,MONTHLYRATE)
values ('ABC','123J','dental', '456J','123','fa',.49)
Select * of question:ABC 123J health 456J 987 0.25
ABC 123J health 456J 453 0.25
ABC 123J health 456J 123 0.25
ABC 123J dental 456J 453 ee 0.29
ABC 123J dental 456J 453 es 0.23
ABC 123J dental 456J 453 ec 0.44
ABC 123J dental 456J 453 fa 0.33
ABC 123J dental 456J 123 ee 0.45
ABC 123J dental 456J 123 es 0.45
ABC 123J dental 456J 123 ec 0.46
ABC 123J dental 456J 123 fa 0.49
I would get the following resultABC 123J health 456J 123 0.25
ABC 123J dental 456J 123 ee 0.45
ABC 123J dental 456J 123 es 0.45
ABC 123J dental 456J 123 ec 0.46
ABC 123J dental 456J 123 fa 0.49
I would like the code to take the minimum of classnumber for each combination of divisonnumber/cover and give me all the records in this classnumber.Thanks in advance.
Hello
This is an example of a Query of Top - N , and Yes, the analytic functions are a good way to do it:
WITH got_r_num AS
(
SELECT ques.*
, RANK () OVER ( PARTITION BY coverage
, divisionnumber
ORDER BY classnumber
) AS r_num
FROM ques
)
SELECT casename, casenumber, coverage, divisionnumber, classnumber, tier, monthlyrate
FROM got_r_num
WHERE r_num = 1
;
Thanks for posting the CREATE TABLE and INSERT, it is very useful!
"PARTITION OF ' is a term often used with analytic functions. "PARTTIION" means also at least two other things in Oracle, so people you better understand if you say "analytic functions", rather than "partition by.
For more info about the RANK function, see this thread:
Re: A "working group"double"SQL query
Tags: Database
Similar Questions
-
Hello. I have Photoshop CS4. Can I use this with the latest Mac OSX version10.10.1?
Hi Sonste,
Greetings.
For many people, it worked, and for some, it didn't.
CS 4 could give you a run-time error java you can download an installation
Suggest you check the link call
http://www.Mac-forums.com/OS-x-operating-system/317803-Adobe-CS4-Yosemite-10-10-a.html
Concerning
Rohit
-
I got nothing else problems with windows update (I use Vista home edition), and now I have the following:
This device does not work properly because Windows cannot load the drivers required for this device. (Code 31)
Device Type Microsoft ISATAP Adapter #3 device peripheral status does not work correctly. Windows cannot load the required device drivers. (Code 31) Plug - and - Play ID ROOT\ * ISATAP\0002
I would really appreciate the help.
Thank you
KarenHello
You can ignore this error message. This error message does not indicate a problem with the adapter. The adapter will continue to function correctly.
http://support.Microsoft.com/kb/932520/en-us
See you soon.
-
can I use Skype with the Ipad Pro or any other IPad?
I want to know if I can use Skype with any kind of IPads?
You can - the latest version of their app requires iOS 8 +: https://itunes.apple.com/us/app/skype-for-ipad/id442012681?mt=8
-
am away at the moment and won't have Internet connection / router. Don't think abt that when I had a wireless model. Ugh.
She seems to have a USB port. Can I operate completely with USB and forget abt the wireless.
of course hope
Thank you
Sue
Yes, of course, you can still use the printer even without internet connection.
You can read this article
Download and install the printer driver and software Via USB
Hope that helps!
-
Windows 7 Home Premium OA product key can be used only with the recovery disk?
I bought an Acer laptop, he arrived with Windows 7 Home Prem OA sticker behind. I've heard, if you want to reinstall windows, we can only use Acer Recovery Disc for this product keys? Is this right? Can I use any other Windows 7 Home Prem CD and install it and then I put the product key of the laptop, it can also?
Thank you
You can use a disk from Windows 7 Home Edition Premium authentic retail.
There is no need to separately download OEM or retail of Windows 7 RTM installation DVD ISO, as the release of Windows 7 installation can be easily converted using simply the correct product key (for example OEM_SLP product key can convert an installation of Windows 7 at retail in OEM version), as issued by the OEM product keys has a different basis of the retail product key. For ISO of DVD images, the only difference between a Windows 7 RTM retail ISO and ISO of OEM of Windows 7 RTM is in position of EI.cfg file [channel], which specifies the sales channel to retail or OEM.
-
I am a new user of Indesign and creative Member Cloud. I was using the fall of the window/Pages to the bottom of the window to view my pages alphabetically or by page number and also to determine whether or not my JPEGs have been sufficiently high resolution of the printer. I don't know how I did it, but somehow the window has changed so that now, there not alphabetical/digital/hi-res information. It shows just the pages in a two pages in numerical order. How to restore the window so that I'll be able to view the information I did previously.
Your help will be appreciated,
Don Unwin
[Personal information]
All I had to do was to click on the links and information in the drop-down list.
-
I can not install indesign with the following message. Can anyone help?
Exit code: 6
Please see specific errors below for troubleshooting. For example, the ERROR:
-------------------------------------- Summary --------------------------------------
-0 fatal Error (s), 2 error (s)
-Payload: Package redistributable Microsoft Visual C++ 2012 (x 64) 11.0.61030.0 {3E272A93-C06B-4206-AD02-0EBE02535E20}.
ERROR: third charge useful Installer vcredist_x64.exe failed with exit code:-2147024546
ERROR: Cannot install the Microsoft Visual C++ 2012 Redistributable Package (x 64).
Errors ' Exit Code: 6, "" Exit Code: 7 ".
Mylenium
-
I can collect data from a hygrometer in a text file using the RS232 port with the following T75.2F:H17.0% format, these data are collected using a data logger software. I was wondering if I can collect this data for later analysis using Dasylab. Any help is appreciated.
The setting below causes the error. Change for the second selection, output values of all channels.
-
Hello:
I'm trying to convert a Word Doc from MS to a PDF file using my new 64 bit Windows 7 system. When in the Word doc, I go to print, then choose PDF and then after the 'conversion', he goes to the notebook with the following message:
%% [ProductName: Distiller] %.
Cambria found, using Courier.
%% [Error: invalidfont;] [OffendingCommand: show] %.
Battery:
()
%% [Flushing: rest of job (end of file) will be ignored] %%.
%% [Warning: PostScript error.] No PDF file produced. ] %%
I'd appreciate someone is able to help me with this problem.
Thank you
Aida
I don't know what PDF "virtual" printer that you use, but you can simply add the free Microsoft SaveToPDF complement for your installation of Microsoft Office and avoid these 'virtual' PDF printers. Your assistant head of household can already do.
Office 2010
Office 2007
These add-ins are explained, as well as other things, to http://office.microsoft.com/en-us/support/?CTT=97
-
HI all I would like to ask if you help me, I want to draw paths, but when I use options to mark with a pen or brush settings I lose quality when I Zoom, can someone help me with the settings for the pen?
The work path is a vector and infinitely scalable, but when caress you, Photoshop sets the pixels on a layer following the path. These pixels are rasterized and based and cannot be resized without loss of quality. You have options. If you want to enlarge the raster layer, transform the work path and stroking again. Or work at a resolution higher, in the first place.
Either incidentally, you can't trace a path with the pen, because it's a vector tool, and caressing is a matrix function based.
-
Using Firefox 4 and Windows 7. Whenever I have to start Firefox from a shortcut to a Web site, what happens with the following error "there was a problem sending the command to the program". The requested site is loaded after that. without any problem.
If a shortcut is used while Firefox is already open the error will not occur.
For me, the problem was the FoxClock extension. Once I disabled it, the problem was gone.
Hope this helps.
Olivier
-
I can't use Roboform with 4.0 beta 10, so I can't use Firefox. How to get back to the beta version 9?
I think that there is a little more for it, but here's a solution that seems to work. After the installation of Roboform 7.1.7, go to: http://www.roboform.com/platforms/browsers/firefox and scroll down to a table listing the three browsers identifying the XPI file to load if it was not loaded automatically. Click the http://www.roboform.com/dist/roboform-firefox-3-4-frozen.xpilink. Firefox will ask you if you want to allow this should be installed. Let him. Finish installation, restart Firefox 4.0b10, and you'll see a Roboform 7.1.7 toolbar works. I did it on two computers, and everything seems to work.
-
Help send emails
I can't send emails with the server that I use to receive. Can you tell me how to find my server going.Your provider of messaging service for this information.
-
I have problems to install the Microsoft 2007 12 updates. They all invariably fail with the following error message:
Error details: Code 8007006E
Any ideas on how I can fix this?
I've got Microsoft Vista.
Hi 1proudmama
Welcome to the Microsoft Answers Forum!
We would like to know are these updates on Office 2007I recommend the methods are:
Method 1:
Step 1:
Uninstall the update failed, if she is found in the installed updates, follow these steps
i. open Control Panel from the start menu
II. Select programs and features
III. click Show on the installed update.
IV. uninstall the update failed
Step 2:
Reset the component of windows update and then try to install updates, check if the problem is resolved. It has Fix tool link below will help you with the same
How to reset the Windows Update components: http://support.microsoft.com/kb/971058Step 3:
Install the stand-alone package containing the updates. You can download the stand-alone version of the link with the number of KB below: http://www.microsoft.com/downloads and check if the problem is resolved.Method 2:
Run the SFC (System File Checker) on the computer scan to fix system errors to the file on the computer.
To run a SFC scan, follow these steps:
Open an elevated command prompt. To do this,
i. Click Start,
II. click principally made programs,
III. click Accessories, right-click command prompt,
IV. and then click Run as administrator.
v. If you are prompted for an administrator password or a confirmation, type the password, or click on allow or continue.
VI. at the command prompt, type sfc/scannow and press ENTER. Once the scan is complete, restart the computer so that the changes take effectBelow link for reference: http://support.microsoft.com/kb/936212
Thank you, and in what concerns:
Samhrutha G S - Microsoft technical support.
Visit our Microsoft answers feedback Forum and let us know what you think.
Maybe you are looking for
-
Standing recalls in the middle of the night and sleep hours does not connect
I get reminders throughout the night to get up and walk for a minute. Put my silent mode shows is not an option that I need to receive calls from work. In addition, my hours of sleep are not connect properly.
-
Is there a way I can install the drivers of 4000 HD directly from the Intel site? I mean, the newest driver HP for the Intel HD 4000 is among more than a year and it is really important (having the latest drivers) For now, I'll have the FPS issues wi
-
Hi guys,. I recently bought the WAG200G and set up and it was working fine. After a month, the problem that has arisen is as follows: I try to search for wireless (WLAN) network but can not find. The PC that is connected via the cable works well, but
-
Hello. Just a simple question about codec audio default on SX80 (TC7.3) H.323 call. Is it somehow possible to change the type of codec to alaw ulaw G.711? Thank you. Marcel
-
How to send a Notification to several email id Workflow Oracle
HelloI have a requirement in R12.1.3 where we send same email Notification multiple identification of in Oracle Workflow. Get us identification of email running for each transaction.Current workflow process is notification is sent to an email Id whic