Home » SQL & PL/SQL » SQL & PL/SQL » Teradata To Oracle MOD Function
Teradata To Oracle MOD Function [message #671207] Thu, 16 August 2018 14:03 Go to previous message
kawi6rr
Messages: 4
Registered: March 2013
Location: Honolulu
Junior Member
Hello All
We're moving over from Teradata to Oracle and I'm having a hard time getting this code to not throw an error. The code in bold is my attempt to convert to oracle and the code below is the original Teradata code. Any help is appreciated, thanks in advance.

Error
ORA-00905: missing keyword
00905. 00000 - "missing keyword"

Code:
SELECT
proc_type
,surg_year
,surg_month
,CASE median_los_hrs

WHEN COUNT(*) OVER (PARTITION BY proc_type, surg_year, surg_month) MOD(1,0) THEN los_hours
WHEN COUNT(*) OVER (PARTITION BY proc_type, surg_year, surg_month) MOD 2 = 1 THEN los_hours

ELSE AVG(los_hours) OVER (PARTITION BY proc_type, surg_year, surg_month ORDER BY los_hours ROWS 1 PRECEDING)

END

FROM surg_base
 
Read Message
Read Message
Read Message
Previous Topic: Put data from one field to another.
Next Topic: FIND MONTHS
Goto Forum:
  


Current Time: Tue Apr 16 15:11:15 CDT 2024