继续获取ORA-00933:SQL命令未正确结束

时间:2016-03-04 14:20:30

标签: sql oracle

我正在尝试修复此查询一段时间,我一直收到错误:

  

ORA-00933:SQL命令未正确结束

关于我可能做错的任何提示。

'------WebKitFormBoundaryjQIb9c3vvKj8TzQ3
 Content-Disposition: form-data; name="album_id"

 2
 ------WebKitFormBoundaryjQIb9c3vvKj8TzQ3
 Content-Disposition: form-data; name="description"

  haiahaahahahdaisdhisadhisadihsdhiiahsd
  ------WebKitFormBoundaryjQIb9c3vvKj8TzQ3
  Content-Disposition: form-data; name="favorite"

  true
  ------WebKitFormBoundaryjQIb9c3vvKj8TzQ3
  Content-Disposition: form-data; name="uploadfile";          filename="test.txt"
  Content-Type: text/plain

  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do   eiusmod
  tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim   veniam,
  quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
  consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
  cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat   cupidatat non
  proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  ------WebKitFormBoundaryjQIb9c3vvKj8TzQ3--
  '

2 个答案:

答案 0 :(得分:3)

()

中删除CURRENT_DATE()
SELECT ACTIVITY_APPROVAL_DATE, COUNT(*)AS ACTIVITY_COUNT 
FROM ACTIVITY 
WHERE ACTIVITY_APPROVAL_DATE = CURRENT_DATE
GROUP BY ACTIVITY_APPROVAL_DATE;

答案 1 :(得分:2)

如果是Oracle,请使用sysdate

SELECT ACTIVITY_APPROVAL_DATE, COUNT(*)AS ACTIVITY_COUNT 
FROM ACTIVITY 
WHERE ACTIVITY_APPROVAL_DATE = TRUNC(sysdate) 
GROUP BY ACTIVITY_APPROVAL_DATE;

如果ACTIVITY_APPROVAL_DATE有时间成分,那么您需要考虑到这一点:

SELECT ACTIVITY_APPROVAL_DATE, COUNT(*)AS ACTIVITY_COUNT 
FROM ACTIVITY 
WHERE ACTIVITY_APPROVAL_DATE >= TRUNC(sysdate) AND
      ACTIVITY_APPROVAL_DATE < TRUNC(sysdate + 1)
GROUP BY ACTIVITY_APPROVAL_DATE;