How To Calculate Expressions With SQL Statements

How To Calculate Expressions With SQL Statements


  • 7 Jan, 2012

    There is no special SQL statements to calculate expressions. But you can use the "SELECT expression FROM DUAL" statement return the calculated value of an expression. "DUAL" is a dummy table in the server. The tutorial exercise below shows you some good examples:SELECT 'Hello world!' FROM DUAL; Hello world!SELECT (1+2)*3/4 FROM DUAL; 2.2500SELECT TRUE FROM DUAL; 1SELECT TRUE AND FALSE FROM DUAL; 0SELECT TIME(SYSDATE()) FROM DUAL; 21:30:26

    Comments Received:
    Please give your suggestions and feedback:

2009-2016 downloadmela.com. All rights reserved.