adspace
how to present a past time in hours, minutes and seconds? : Sql dba
Answer Posted / Amit Kumar Bajpai
To present the time in hours, minutes, and seconds from a timestamp column or variable in SQL, you can use date/time functions like EXTRACT. Here is an example for both MySQL and Oracle:nnMySQL:n```sqlnSELECT CONCAT(HOUR(TIMESTAMP_COLUMN), ' hours ', MINUTE(TIMESTAMP_COLUMN), ' minutes ', SECOND(TIMESTAMP_COLUMN), ' seconds');n```nOracle:n```sqlnSELECT TO_CHAR(TIMESTAMP_COLUMN, 'FFYY HH24:MI:SS') FROM dual;n```
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Can delete statement be rollbacked?
Is primary key always clustered index?
What is the current version of sql?
Can we use distinct and group by together?
what is dbms? : Sql dba
what are aggregate and scalar functions? : Sql dba
If a cursor is open, how can we find in a pl/sql block?
how to escape special characters in sql statements? : Sql dba
what is collation? : Sql dba
what is bcp? When does it used? : Sql dba
Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me
Is primary key clustered index?
what are all the common sql function? : Sql dba
How do I remove duplicates in two columns?
how to start mysql server? : Sql dba