home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 3163
Discussions: 188,374, Posts: 2,243,436, Members: 232,603
Old November 11th, 2002, 04:24 PM   Digg it!   #1 (permalink)
Member
 
tenor_david's Avatar
 
Join Date: Nov 2001
Location: Bloomington IN
Posts: 219
Oracle Help

I have a Table that tracks temperatures of a state on different days of different months. I would like to query this table and return the Average Temp for each month of the year. Any thoughts on how to do this?

Thanks

tenor_david is offline   Reply With Quote
Old November 22nd, 2002, 03:53 AM     #2 (permalink)
Member
 
Join Date: Sep 2002
Posts: 364
select avg(temp_field) as AvgTemp, month(date_field) as MonthDate, year(date_field) as YearDate
group by month(date_field), year(date_field)

I dont use Oracle, but that should be fairly standard SQL.

Creosote is offline   Reply With Quote
Old November 28th, 2002, 06:01 PM     #3 (permalink)
Ultimate Member
 
Join Date: Oct 2001
Posts: 21,017
you forgot FROM

select avg(temp_field) as AvgTemp, month(date_field) as MonthDate, year(date_field) as YearDate
group by month(date_field), year(date_field)

Code:
SELECT avg(temp_field) as AvgTemp, 
       month(date_field) as MonthDate, 
       year(date_field) as YearDate
FROM [tablename]
GROUP BY month(date_field), year(date_field)

vass0922 is online now   Reply With Quote
Old November 30th, 2002, 03:19 AM     #4 (permalink)
Member
 
Join Date: Sep 2002
Posts: 364
I must have fallen asleep, or I just figured he would figure that out or something. LOL
Creosote is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Most Active Discussions
Is It Just Me? (2881)
The United States Debt (20)
Looks like Burris will get his Sena.. (7)
Upgrading RAM (5)
I think I just killed my computer w.. (24)
Folderchat Weekday thread (436)
Antec 300 bulk purchase? (11)
Worth the upgrade?? (14)
Titan quest and Immortal Throne, an.. (17)
Recent Discussions
Best digital camera for under 2.. (13)
Building first computer, will t.. (2)
Folderchat Weekday thread (436)
Help with an Ati Radeon HD 4850.. (22)
CPU wont boot (2)
get this error, "res://C:\.. (73)
Problem with boot and motherboa.. (0)
MS to offer free Windows 7 upgr.. (1)
System Security Virus (20)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 07:26 PM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28