Getting date and time



IBM's flagship relational database management system

Getting date and time

Postby pcdoctor » Tue May 13, 2008 9:08 pm

Hi,

I would like to know as to how could we get the system date and time using a query..??Pls explain..

Also..Consider the below select statement..

Select salary * 1.1 from Emp


while displaying the results of this wat would be the column name of the result..Will it be system defined like Expression1 or somethin els??

Thanks in Advance
pcdoctor
 
Posts: 17
Joined: Mon Feb 18, 2008 10:21 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Getting date and time

 

Re: Getting date and time

Postby CICS Guy » Wed May 14, 2008 8:05 pm

pcdoctor wrote:I would like to know as to how could we get the system date and time using a query..??Pls explain..

Have you looked at the manual?
Datetime special registers: The datetime registers are named CURRENT DATE, CURRENT TIME, and CURRENT TIMESTAMP. Datetime special registers are stored in an internal format. When two or more of these registers are implicitly or explicitly specified in a single SQL statement, they represent the same point in time. A datetime special register is implicitly specified when it is used to provide the default value of a datetime column.
pcdoctor also wrote:Also..Consider the below select statement..
Select salary * 1.1 from Emp

while displaying the results of this wat would be the column name of the result..Will it be system defined like Expression1 or somethin els??
Something like Expression1 I'd think......
CICS Guy
 
Posts: 255
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post