Sorry if my question sounds dumb but I'm relatively new to coding especially in Oracle SQL Developer and really need help. I used to use mySQL. So I'm still a little confused.
Here is my code:
CREATE VIEW ViewC AS
SELECT * FROM watermeter
WHERE deployeddate <= dateadd(month,-6, getdate()) AND
deployeddate > CURRENT_DATE();
The code error:
Error starting at line : 1 in command -
CREATE VIEW ViewC AS
SELECT * FROM watermeter
WHERE deployeddate <= dateadd(month,-6, getdate()) AND
deployeddate > CURRENT_DATE()
Error report -
ORA-00933: SQL command not properly ended
00933. 00000 - "SQL command not properly ended"
*Cause:
*Action:
In case you wanna know, the question is: List the meters that are due for replacement in the next six months (this view should be able to work at any time in the future without needing to be changed to accommodate the date).
There isn't any function like Dateadd in Oracle. You can use
OUTPUT: 01-AUG-17 01.33.57.929000000 PM -07:00
TO_CHAR( DATE'2017-01-01', 'DL' )