Saturday, May 8, 2010

SELECT AS CLAUSE

0 comments

In SQL Query you can define column heading jus write heading near to field name with out any space but if you want to make space in column heading then use AS clause like wise
Column Heading with out AS Clause
SELECT LASTNAME, SALARY TotalSalary
FROM EMP
WHERE WORKDEPT = 'C01'
ORDER BY 2 DESC
Column Heading with space
SELECT LASTNAME, SALARY + BONUS + COMM AS TOTAL EANINGS
FROM EMP
WHERE WORKDEPT = 'C01'
ORDER BY TOTAL_EANINGS DESC

0 comments: