Message-Id: <10738.126467@fatcity.com> From: "Naik, Kevin K" Date: Fri, 12 Jan 2001 08:50:57 +0200 Subject: SQL Code This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C07C64.043CC840 Content-Type: text/plain; charset="iso-8859-1" Hi All, I have an interesting problem, lets say I have a table with 2 fields, one with a code, and the other with a full datestamp, -+ 8 million records. What will the SQL code be to query this table, to show the result - the count of all codes that occur between every hour for the day, ie 5 counts of code type a, 6 of type b etc, between 01h00 and 02h00 7 counts of type a, 8 of b etc, between 02h00 and 03h00 etc etc etc Any ideas anybody ? Thanx Kevin N ______________________________________________ Disclaimer and confidentiality note Everything in this e-mail and any attachments relating to the official business of Standard Bank Investment Corporation (Stanbic) is proprietary to the company. It is confidential, legally privileged and protected by law.\ Stanbic does not own and endorse any other content. Views and opinions are those of the sender unless clearly stated as being that of Stanbic. The person addressed in the e-mail is the sole authorised recipient. Please notify the sender immediately if it has unintentionally reached you and do not read, disclose or use the content in any way. Stanbic can not assure that the integrity of this communication has been maintained nor that it is free of errors, virus, interception or interference. ______________________________________________ ------_=_NextPart_001_01C07C64.043CC840 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable SQL Code

Hi All,

I have an interesting problem, lets say I have a table = with 2 fields, one with a code, and the other with a full datestamp, -+ 8= =20million records.

What will the SQL code be to query this table, to show = the result - the count of all codes that occur between every hour for the= =20day, ie

5 counts of code type a, 6 of type b etc, between 01h00= =20and 02h00
7 counts of type a, 8 of b etc, between 02h00 and 03h0= 0 etc etc etc

Any ideas anybody ?
Thanx
Kevin N

______________________________________________

Disclaimer = and=20 confidentiality note

Everything in = this e-mail and=20 any attachments relating to the official business of Standard Bank Invest= ment=20 Corporation (Stanbic) is proprietary to the company. It is confidential, leg= ally=20 privileged and protected by law. Stanbic does not own and endorse any= =20other=20 content. Views and opinions are those of the sender unless clearly stated= =20as=20 being that of Stanbic.

The person add= ressed in the=20 e-mail is the sole authorised recipient. Please notify the sender immedia= tely if=20 it has unintentionally reached you and do not read, disclose or use the c= ontent=20 in any way.

Stanbic can not assure that the integrity of this communication has be= en=20 maintained nor that it is free of errors, virus, interception or=20 interference.

          &nbs= p;  _______________________________________________

<=