SELECT STATEMENT -..Continued

SELECT STATEMENT –  Continued

 In a ISQL select statement only SELECT and FROM statements are mandatory. Other clauses like

WHERE,GROUP BY,HAVING,ORDER BY are optional.

    How to use expressions in ISQL SELECT Statement?

Expressions combine many arithmetic operators, they can be used in SELECT, WHERE and ORDER BY Clauses of the ISQL SELECT Statement.

Here we will explain how to use expressions in the SQL SELECT Statement. About using expressions in WHERE and ORDER BY clause, they will be explained in their respective sections.

The operators are evaluated in a specific order of precedence, when more than one arithmetic operator is used in an expression. The order of evaluation is: parentheses, division, multiplication, addition, and subtraction. The evaluation is performed from the left to the right of the expression.

For example: If we want to display the desc and stk_qty combined together, the ISQL Select Statement would be like

SELECT desc,” “,stk_qty from m_stock;

Output:

Desc                                                  Stk_qty

Paint 1000
MS Sheet 2000
Rubber Gasket 5000
Welding rode 500
Cotton waste 100

 

 

About kpvarkeys

Law Graduate from Pune University.Worked In Ministry of Defence,Indian Ordnance Factories in IT field
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a comment