Sunday, 31 August 2014

SQLSERVER TIPS & TRICKS

--For Single Quote Special Character, need to use Single quote 2 times.
CHARINDEX :
charindex('"',BRule)

LEAD & LAG :
select RId,a.t_Attribute, LEAD(a.t_Attribute) over(partition by RId,a.Ctribute order by RId,a.Ctribute) Leadvalue, LAG(a.t_Attribute) over(partition by RId,a.Ctribute order by RId,a.Ctribute) LagValue,a.Ctribute
from  PCOLS

SUBSTRING & REPLACE :
1)substring(ppin,1,len(RIdentifier)
2)replace(brule,'.','_')


 

Are You Thinking?????????????????????

                      Question Yourself for few Seconds?                         Are you Thinking at all?                              When ...