Home » SQL & PL/SQL » SQL & PL/SQL » "%s: invalid identifier" during Over(Partition by..) (Oracle SQL Developer)
"%s: invalid identifier" during Over(Partition by..) [message #601595] Fri, 22 November 2013 10:57 Go to next message
airnel48
Messages: 1
Registered: November 2013
Location: United States
Junior Member
Any idea why I'm receiving the invalid identifier error? It's my first time using Over(Partition by

SELECT
a.day AS date
b.location AS region,
c.item AS product,
d.details AS description,
SUM(a.hours) over(partition BY a.day, b.location, c.item, d.details) AS item_hours,
SUM(a.hours) over(partition BY a.day, b.location, d.details) AS hours,
FROM Time_data a,
Geography_data b,
Items_data c,
Description_data d
WHERE a.code = b.code
AND a.code = c.code
AND a.code = d.code


Error report:
SQL Error: ORA-00904: "C"."item": invalid identifier
Re: "%s: invalid identifier" during Over(Partition by..) [message #601597 is a reply to message #601595] Fri, 22 November 2013 11:06 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
airnel48 wrote on Fri, 22 November 2013 08:57
Any idea why I'm receiving the invalid identifier error? It's my first time using Over(Partition by

SELECT
a.day AS date
b.location AS region,
c.item AS product,
d.details AS description,
SUM(a.hours) over(partition BY a.day, b.location, c.item, d.details) AS item_hours,
SUM(a.hours) over(partition BY a.day, b.location, d.details) AS hours,
FROM Time_data a,
Geography_data b,
Items_data c,
Description_data d
WHERE a.code = b.code
AND a.code = c.code
AND a.code = d.code


Error report:
SQL Error: ORA-00904: "C"."item": invalid identifier



"C"."item" is different from c.item

I suspect that some portion of above is not an actual COPY & PASTE of code that threw posted error
Re: "%s: invalid identifier" during Over(Partition by..) [message #601622 is a reply to message #601595] Sat, 23 November 2013 03:40 Go to previous message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
airnel48 wrote on Fri, 22 November 2013 22:27

SUM(a.hours) over(partition BY a.day, b.location, d.details) AS hours,
FROM Time_data a,


You should NOT have a comma at the end of column list. Is it just a typo or the original code?
Previous Topic: exact definition of Collection
Next Topic: FIND AGE
Goto Forum:
  


Current Time: Fri Apr 26 10:36:55 CDT 2024