473,786 Members | 2,426 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with query on sparse timeseries data

Good morning,

I have a table like (Date, Hour, Value) where Date can be any date,
Hour is always between 6 (6am) to 22 (10pm) and Value is an integer.

E.G.

Date Hour Value
23/2/2002 6 2
23/2/2002 7 3
23/2/2002 8 2
23/2/2002 12 5

24/2/2002 8 9
24/2/2002 9 1
24/2/2002 10 2
24/2/2002 11 2
.....

please note that some hour can be missing inside the same date, for
instance hour 9,10,11,13,14,1 5,16,17,18,19,2 0,21,22 are missing for
date 23/2/2002 and hour 6 and 7 are missing for date 24/2/2002

I need a query to list for every date and hour the corresponding value
but including also any missing hour (for missing hour the default for
Value is 0).

E.G.

Date Hour Value
23/2/2002 6 2
23/2/2002 7 3
23/2/2002 8 2
23/2/2002 9 0
23/2/2002 10 0
23/2/2002 11 0
23/2/2002 12 5
23/2/2002 13 0
23/2/2002 14 0
23/2/2002 15 0
23/2/2002 16 0
23/2/2002 17 0
23/2/2002 18 0
23/2/2002 19 0
23/2/2002 20 0
23/2/2002 21 0
23/2/2002 22 0
24/2/2002 6 0
24/2/2002 7 0
24/2/2002 8 9
24/2/2002 9 1
24/2/2002 10 2
24/2/2002 11 2
.....
How can I achieve this ?

Thanks.

Sep 26 '08 #1
0 1643

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3653
by: Darryll Petrancuri | last post by:
Greetings! I could really use some suggestions on how to improve on the following, it at all possible: Table 'Customer' --------------------- ID GUID PK ....
0
1934
by: Jim | last post by:
I need some help getting started with a .NET web project for a commercial site. I am new to .NET and my understanding of some (but not all) of its concepts is a little sparse. I apologize for the length of this message, but hopefully it will help someone here give me the most concise and useful information, and perhaps help others out as well. :) It's been a while since I've had to design anything "real" for the web. I think the last...
10
5683
by: draghuram | last post by:
Hi, Is there any special support for sparse file handling in python? My initial search didn't bring up much (not a thorough search). I wrote the following pice of code: options.size = 6442450944 options.ranges = fd = open("testfile", "w") fd.seek(options.size-1)
0
1386
by: David | last post by:
I've just recently read several articles that state that the only way to write "sparse zeros" to an NTFS5 sparse file is to use Win32 DeviceIoControl with FSCTL_SET_ZERO_DATA in order to specify what ranges in the file are sparse zeros. However, it appears that the following steps also work when creating a new sparse file. First, using Win32 (via .NET 1.1 pinvoke), I ... CreateFile (returns a handle)
3
3224
by: beachlounger | last post by:
Using C++ language to complete this homework 1. Develop class Polynomial. The internal representation of a Polynomial is an array of terms. Each term contains a coefficient and an exponent. The term 2x4 has the coefficient 2 and the exponent 4. Develop a complete class containing proper constructor functions as well as set and get functions. The class should also provide the following overloaded
4
7648
by: deLenn | last post by:
Hi, Does scipy have an equivalent to Matlab's 'find' function, to list the indices of all nonzero elements in a sparse matrix? Cheers.
3
5845
by: mediratta | last post by:
Hi, I want to allocate memory for a large matrix, whose size will be around 2.5 million x 17000. Three fourth of its rows will have all zeroes, but it is not known which will be those rows. If I try to allocate memory for this huge array, then I get a segmentation fault saying: Program received signal SIGSEGV, Segmentation fault. 0xb7dd5226 in mallopt () from /lib/tls/i686/cmov/libc.so.6
5
9716
by: adam.kleinbaum | last post by:
Hi there, I'm a novice C programmer working with a series of large (30,000 x 30,000) sparse matrices on a Linux system using the GCC compiler. To represent and store these matrices, I'd like to implement the sparse matrices as a doubly-linked list, in which each non-zero cell is stored roughly as follows: int rownum int colnum
3
7847
by: victorporton | last post by:
D.K. is traveling from City A to City B. He can stop at some designated spots only. I am trying to use Dijkstra’s algorithm to determine the “spot-to-spot” path that will get D.K. from City A to the City B in the minimum amount of time. The input in my program is an integer n and the 2D coordinates of n spots. Some assumptions have been made about the physical layout of the problem: 1) All the spots are considered to be in a square of...
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9496
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10164
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8989
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3669
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.