Interview Answer

When someone says, I want a programming language in which I need only say what I want done, give him a lollipop. Alan Perlis

Write a SQL query to display the current date

January 1, 1970 12:00 am

Comments



Write a SQL query to display the current date


The DUAL table is a special one-row, one-column table present by default in Oracle and other database installations. The sysdate returns the current date from the oracle database server.

													SELECT sysdate from dual;
													

The to_char funcation format the date.


Solution

   					 SELECT TO_CHAR(SYSDATE, 'MM-DD-YYYY HH24:MI:SS') "NOW"  FROM DUAL;				    

Comments



Please login to add comments.