nikhilboorla Posted March 25, 2015 Report Posted March 25, 2015 How to find no of emp joined every month in 1981?
Swathi1 Posted March 25, 2015 Report Posted March 25, 2015 SELECT Trunc(EMP_JN_DT,'MM') Emp_Jn_Mth,Count( * )FROM EMP_REGWHERE EMP_JN_DT between date '2009-01-01' AND date '2009-12-31'GROUP BY Trunc(EMP_JN_DT,'MM')ORDER BY 1;
manjunath455 Posted March 25, 2015 Report Posted March 25, 2015 babu nee table lo e columns vunnayo, sample data teliyakunda ela cheptaru evaraina??
manjunath455 Posted March 25, 2015 Report Posted March 25, 2015 SELECT Trunc(EMP_JN_DT,'MM') Emp_Jn_Mth,Count( * )FROM EMP_REGWHERE EMP_JN_DT between date '2009-01-01' AND date '2009-12-31'GROUP BY Trunc(EMP_JN_DT,'MM')ORDER BY 1; endi vayya idi
Swathi1 Posted March 25, 2015 Report Posted March 25, 2015 endi vayya idi google chesa vachhindhi...copy chesi paste chesa......aa paina vunna query ni elagola ardam chesukoni chesthadu emo ani esa
nikhilboorla Posted March 25, 2015 Author Report Posted March 25, 2015 Data will be default emp table in scott user
sanbk Posted March 25, 2015 Report Posted March 25, 2015 alage naaku kuda oka sql rasi pettandi eg: 12345678929 dentlo fourth figit daggara '-' and 7th digit dagarra '-' ravali output: 123-56-8929 ila print avvali..
Darling999 Posted March 25, 2015 Report Posted March 25, 2015 alage naaku kuda oka sql rasi pettandi eg: 12345678929 dentlo fourth figit daggara '-' and 7th digit dagarra '-' ravali output: 123-56-8929 ila print avvali.. Use substring dude you wil be good and replace it with - .
manjunath455 Posted March 25, 2015 Report Posted March 25, 2015 sorry for the late reply Idi work avutundi choodu man select datepart(year,[DateStarted]),datepart(month,[DateStarted]),count(*) from [stage].[Employee] where datepart(year,[DateStarted])=1981 group by datepart(year,[DateStarted]),datepart(month,[DateStarted]) order by datepart(year,[DateStarted])
manjunath455 Posted March 25, 2015 Report Posted March 25, 2015 Use substring dude you wil be good and replace it with - . Tbale lo vunna prati okka record ki cheyalante replace vadalemu ba. I think we can use stuff function here select stuff(substring('123456789',1,4),4,0,'-')+ stuff(substring('123456789',7,len('123456789')),1,0,'-') Pls correct me if I am wrong
Recommended Posts