SQL Interpolation of time. Is this Possible?
I have a table Named FAC_TABLETime (DateTime)_ | _Value (Number)
2008-02-01 10:16:04, _ | ___10
2008-02-01 10:18:04, _ | ___13
2008-02-01 10:19:04, _ | ___11
2008-02-01 10:20:04, _ | ___12
2008-02-01 10:21:04, _ | ___10
2008-02-01 10:23:04, _ | ___11
2008-02-01 10:24:04, _ | ___16
2008-02-01 10:25:04, _ | ___15
2008-02-01 10:27:04, _ | ___15
We have values according to time, with a common time interval. My need is for interpolation and obtain values at determined time interval say by 5 min'.
Is it possible to create a SQL query to get values interpolated in a certain period of time?
example of output: -.
Time (DateTime)_ | _Value (Number)
2008-02-01 10:16:04, _ | ___10
2008-02-01 10:21:04, _ | ___10
2008-02-01 10:26:04, _ | ___15
Here there is no time February 1, 2008 10:26:04 ' in Raw data but Interpolation will get the data according to time.
I can do this programmatically by getting all the values in the DB, but more iteration is needed to get the DB and for treatment. So I'm looking for a SQL solution. Is this Possible?
I'm using Oracle 11 g.
Published by: mCm on February 20, 2012 22:32
Hello
Welcome to the forum!
Of course, you can do it in pure SQL. Here's one way:
WITH actual_values AS
(
SELECT time
, LEAD (time) OVER (ORDER BY time) AS next_time
, value
, LEAD (value) OVER (ORDER BY time) AS next_value
FROM fac_table
)
, desired_times AS
(
SELECT min_time + ( (LEVEL * 5)
/ (24 * 60)
) AS time
FROM (
SELECT MIN (time) AS min_time
, MAX (time) AS max_time
FROM fac_table
)
CONNECT BY LEVEL <= 5 * ( (max_time - min_time)
* (14 * 60)
)
)
SELECT d.time
, a.value + ( (a.next_value - a.value)
* ( (d.time - a.time)
/ (a.next_time - d.time)
)
) AS interpolated_value
FROM actual_values a
JOIN desired_times d ON d.time >= a.time
AND d.time < a.next_time
;
Sorry, I'm not a database now, so I can't test this.
The above query assumes that fac_table.time is unique, and that fac_table.value is not NULL.
Published by: Frank Kulash, February 20, 2012 07:57
Tags: Database
Similar Questions
-
Original title: unable to disable my lan connection
Remember - this is a public forum so never post private information such as numbers of mail or telephone!
Ideas:
I turn off my connection to the local network, it is showing message.
It is not possible to disable the connection at this time. This connection may be using one or more protocols that don't support Plug-and-play, or it may have been initiated by another user or the system account.
Please answer soon
You have problems with programs
- Error messages
- Recent changes to your computer
- What you have already tried to solve the problem
Hi MVTDA,
You can try the following methods and check to see if it helps:
Method 1:
a. Click Start and select run, type cmd and click OK.
b. type net stop cryptsvc and press ENTER.
c. type ren %systemroot%\System32\Catroot2 oldcatroot2, and then press the Enter key.
d. restart the computer.
e. open new command prompt and Type net start cryptsvc, and press ENTER.
Method 2:
If the same problem persists then you can try to uninstall the network drivers and check.
a. click the Start button. Select run, type devmgmt.msc and press OK.
b. Select the network card and right click on it.
c. now, select Properties.
d. in the Properties window, on the driver tab, click Uninstall.
e. After you have uninstalled the drivers, restart the computer.
Hope this information is useful.
Jeremy K
Microsoft Answers Support Engineer
Visit our Microsoft answers feedback Forum and let us know what you think.If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.
-
Closure of a SELECTION of tabs at once. Is this possible?
Hi, I'm an average user of tabs. Let's say I opened 25 tabs in a window/session. I want to select 5 tabs to close, at one time, but without using the tabs groups/panorama that I am too clumsy use this feature. :-) I mean it takes more time to create your groups and then close the group. I would prefer to select my tabs and close them then directly from my window screen. Is this possible?
See:
- Multiple Tab Handler: https://addons.mozilla.org/firefox/addon/multiple-tab-handler/
-
Since the update for Firefox 4, I offer more the ability to save tabs on shutdown - makes more rapid access to these sites when commissioning the next day. Why this possibility has been removed? It was a feature favorite and saved a lot of time.
Firefox 4 records the previous session.
You can use "Firefox > history > restore previous Session" for the previous session.
There is also a button 'Restore previous Session' on the default on: Home home page.Another possibility is to use:
- Tools > Options > general > startup: "When Firefox starts": "show my windows and tabs from last time '.
You can set the preferences of warning on the topic: config page true via the context menu or toggle the value with a double click of the left.
- browser.showQuitWarning, see http://blog.zpao.com/post/3174360617/about-that-quit-dialog
- browser.tabs.warnOnClose, see http://kb.mozillazine.org/About%3Aconfig_entries
- browser.warnOnQuit, see http://kb.mozillazine.org/browser.warnOnQuit
- browser.warnOnRestart, see http://kb.mozillazine.org/browser.warnOnRestart
To open the topic: config page, type Subject: config in the address bar (address) and press the 'Enter' key, as you type the url of a Web site to open a Web site.
If you see a warning then you can confirm that you want to access this page. -
I have a 2015 13-inch macbook pro Retina display. What is the best way to keep the battery in good conditions? In particular: When should I charge it? Only when the power is low)<20%) or="" anytime="" that="" i="" can?="" more="" in="" particular:="" if="" i="" keep="" it="" in="" charge="" all="" the="" time,="" will="" this="" be="" good="" or="" bad="" for="" the="" battery?="" will="" it="" reduce="" the="" number="" of="" battery="" cycles="" that="" i="" would="" otherwise="" have?="" many="">20%)>
Keep the computer plugged in whenever possible.
If you keep the computer always connected, make sure that at least twice a month
Run it on battery until battery charge level falls to about 40-50%.
Please don't completely discharge the battery. Discharge the battery completely will reduce wear and tear on the battery.
Trying to keep the number of Cycles of battery low does ' t help.
For more information:
Section: To optimize the battery life
http://support.Apple.com/en-us/HT204054
Best.
-
I have two cameras (JAI - HP - M4 + CL) and I would like to take images captured at the same time two of them by a Council NI PCIe-1430, using an external trigger. Is this possible? Is there another type of solution for my problem? What I need is just two images synchronized acquisition!
concerning
Yes, the 1430 has two completely independent engines of acquisition which can acquire separately or simultaneously. You want to probably use some kind of trigger to trigger both cameras at the same time because the cameras themselves would not be undergoing otherwise. You can use the jury IMAQ itself to generate a trigger if you want.
Eric
-
I want to use the registration of custom with hyper-site domain object merges? Is this possible?
Hey,.
At that time, saving custom object data cannot be used with following:
- with Hypersite field mergers;
- with the research data on the data in the field, only the number of overall;
- on off key Dynamic Content in the emails
Thank you
-
I know that there are ways to draw search engine data, data of social media and then the site as a whole, but I'm looking for the ability to find data from sources of traffic for a specified page of a site group. Is this possible in Eloqua 10? Thank you
Hi Melissa,
I think that's what you're looking for:
If you run the report Page Navigations of Insight, you can then filter on "Web Page" choose only the subset of pages on which you are interested to report. The report will then show you all the previous pages (traffic sources) that were visited before visiting an of these subset of pages. The only downside is that it shows it as a 1:1, it will show all the previous pages for Page A, all the previous pages for Page B, etc. - so you can see the same previous page on the list several times. You can export to Excel, however, and twist a little bit for us hopefully get final report wanted.
Hope that helps!
Kim
-
I would like to install a copy of the CS6 on mac with os x and pc with WIN7. Is this possible?
In order to use it on Mac, you will need to purchase another license for Mac.
Purchase CS 6 Creative Cloud now includes Creative Suite Master Collection and Design Premium features
Or, you can go for creative cloud that you can use on both machines Alternately, one at a time. Pricing and membership creative cloud plans | Adobe Creative Cloud
-
Hello, I installed adobe illustrator (I pay every month) and I would install illustrator in another computer. Is this possible?
Yes, your subscription allows you to have the software installed and signed in two machines. You can actually install on as many as you want, but only two can be signed at the same time.
-
I have 3 devices I want to use Photoshop on. Is this possible without having to pay for 3 different accounts?
Hi career,.
You can stay connected to creative cloud to two devices at the same time.
If you want to use on the third device, you must disconnect from one of the other two devices so that you can connect to the third.
Kind regards
Claes
-
I am a student and I want adobe creative cloud for school, so I just want to pay for 6 or 7 months, is this possible or should I pay a year? Thank you
Pricing plans and creative Cloud membership | Adobe Creative Cloud
For the first 12 months (promotional price)
Annual plan, paid monthly = US$ 20 x 12 months = $240
7 months
Annual plan, paid monthly = US$ 20 x 7 months + (5 x $20 x 50%) cancellation fee = $190.
There is no plan of months-by-momth, cancel-all-time for student and teacher version.
-
My laptop was stolen. The CreativeSuite has been installed. I also have programs on my Mac work in the office. When I buy a new laptop, I have to install the programs on the third computer. Is this possible? What can I do?
Hello
You can install and activate the perpetual software (purchased) two computers of the same type (mac or pc), as long as you use it on one at a time.
For deactivation refer:- https://helpx.adobe.com/x-productkb/policy-pricing/activate-deactivate-products.html
If you do not have access to your old computer because you have replaced a hard drive, upgraded your operating system to format your computer before you deactivate your software or your computer is dead, you can ask Adobe Support to help you disable from a machine, you cannot access. Have your serial number or Adobe ID ready, then contact us.
To load the software on another computer, download and install it as you did on the first computer. Then enter your serial number to activate it.
You can also see: -.
https://helpx.Adobe.com/x-productkb/policy-pricing/error-maxium-acitvation-exceeded.html
-
I accidentally installed the Illustrator CC 2015 update and want to return to the CC2014 version. Is this possible and if so, how? The interface has changed to a level that it costs me much too much time to adjust when facing a deadline. Any help much appreciated.
Hi Don,
Please see this link to install versions of Creative Cloud 2014:
Direct download links of Adobe CC 2014: 2014 creative cloud release | ProDesignTools
Let me know if it helps.
Kind regards
Megha Rawat
-
I have Photoshop elements 11 on my mac-book now I want to copy the program on my Mac Pro too.
Is this possible or should I buy another license?
You are allowed to install and enabled on both computers at the same time, but you can never copy an installed copy of PES. You must install it from scratch on the Mac Pro. If you need the file, you can download it here:
Maybe you are looking for
-
Firefox still block Adobe Flashplayer?
I uninstalled my Adobe Flashplayer last month after that Mozilla has blocked. Now has been released by Mozilla?Thank you.
-
How to import bookmarks from before browser?
I have Firefix installation on 2 laptops. The first installation taken all my favorites from my old front Browser. The second installation was not picking up my favorites, how can I get my favorites in Firefox?
-
Apple Dock of lightning - line level output?
I have a question that maybe with that you audiophiles out there can help. Descriptions and comments from the dock connector 30 pins for the pre at first touch screen iPod claimed (correctly I think) that the mini stereo 3.5 mm output port of these
-
PageWide Pro 577 HP MFP: HP PageWide Pro 577 MFP Printing with random pimples on some pages
I have two problems with my new MFP HP PageWide Pro 577 eventhough I later installed the drivers and firmware: I printed more than 1,000 'professional' and a few pages of quality 'Présentation' on this week less 2 NEW printer. I believe all > 100 pri
-
Loss of CD/DVD driver on the upgrade to Windows 10
I have a gateway all-in-One ZX4270 model which I updated from Windows 8.1 to 10. Everything is OK except that I apparently lost my CD/DVD drive in the process. He is still physically there, and he turns a drive when it is inserted, but the computer