|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Timestamp computation
good day to all.
im newbie to sql. i want to achieve to compute for Average of encoder speed input. i have this two table name cocv_2004 and with the ff columns; -- cocv_id -- personality_id -- province_code -- municipality_code -- votes -- db_user -- timestamp and table name cc_encodersee with columns: -- cc_encodersee_id -- cc_id -- polparty_id -- db_user -- timestamp can anyone help me how to select out from this table of an avegare speed output refering from timestamp column? id like it to have a select only on columns cc_encodersee_id, db_user, and timestamp(for average speed computation). is there a way to compute time in sql queries function? can u give me with this example.? thanks in advance.. |
|
#2
|
||||
|
||||
|
Have you tried something like this?
Code:
SELECT AVG(TimeStampField) FROM Table |
|
#3
|
|||
|
|||
|
Quote:
yes i tried that query but it gives me an error: Code:
ERROR: Function avg(timestamps) does not exist Unable to identify a function that satisfies the given argument types You may need to add explicit typecasts this is the actual SQL that i used. Code:
SELECT AVG(timestamp) AS average, db_user FROM cc_endorsee GROUP BY db_user; and BTW im using PostgresQL 7.3.2 i hope thats not the issue. How can i solve this? thanks again for help! |
|
#4
|
||||
|
||||
|
Quote:
Well, it is when your posting the question in the SQL Server forum without even mentioning it in your initial post. One (I) would automatically assume you were using SQL Server. |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Timestamp computation |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|