Jump to content

Recommended Posts

Posted

How to find no of emp joined every month in 1981?

Posted

SELECT Trunc(EMP_JN_DT,'MM') Emp_Jn_Mth,
Count( * )
FROM EMP_REG
WHERE EMP_JN_DT between date '2009-01-01' AND date '2009-12-31'
GROUP BY Trunc(EMP_JN_DT,'MM')
ORDER BY 1;

Posted

babu nee table lo e columns vunnayo, sample data  teliyakunda ela cheptaru evaraina??

Posted

SELECT Trunc(EMP_JN_DT,'MM') Emp_Jn_Mth,
Count( * )
FROM EMP_REG
WHERE 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 pfdb_brahmi38.gif

Posted

endi vayya idi pfdb_brahmi38.gif

google chesa vachhindhi...copy chesi paste chesa......aa paina vunna query ni elagola ardam chesukoni chesthadu emo ani esa 

Posted

Data will be default emp table in scott user

Posted

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

 

Posted

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 - .
Posted
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])

 

Posted

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
×
×
  • Create New...