hello
can u give me the code to unpivot the table? wats the difference between rdbms and dbms there r various sql function like len(),abs(),difference etc,so exactly wats the use of these function in sql,where do we apply these function?
hello
can u give me the code to unpivot the table? wats the difference between rdbms and dbms there r various sql function like len(),abs(),difference etc,so exactly wats the use of these function in sql,where do we apply these function?
All of these very general and basic questions are easily answerable by reading BOL (Books On Line) http://msdn.microsoft.com/en-us/library/ms130214.aspx
len(), abs() are functions you apply within TSQL statements to get, the number of characters in an expression or to get the absolute point value of a numeric expression. There are lots and lots of functions that you can use in either string manipulation, len(), or mathematics, abs(), within SQL Server. There is no hard and fast rule that you MUST use them, but logically, you may need them within a function depending on the logic required.
For example, just taking the len() function, let's say, I wanted to get everything to the right of the first space inside some text. Using AdventureWorks2008, I could write a query like this:
SELECT p.Name, RIGHT(p.Name,(LEN(p.Name)-CHARINDEX(' ',p.name)) FROM Production.Product AS p
This will then return, for example, two columns, one that reads 'Adjustable Race' and the other that reads 'Race.'
No one has followed this question yet.