question

java avatar image
java asked

multiple question

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?

t-sql
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David 1 avatar image David 1 commented ·
I think you need to make an attempt to be more specific about what you want to know. This is not the place for a tutorial.
1 Like 1 ·
dave ballantyne avatar image
dave ballantyne answered

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

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Grant Fritchey avatar image
Grant Fritchey answered

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.'

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.