January 9th, 2004, 10:19 PM
hi..i'm using the oracle db. The following sql quey can run in php(but returns the wrong result), but cannot run in oracle sql plus. Can someone tell me what's wrong?
SQL> select distinct( acav_cardno ), acch_icno, acch_accesscode, acav_cardholdername from ac_cardholder, ac_activity where trunc(acav_trxdatetime) between to_date('01-11-2003','dd-mm-yyyy') and to_date('30-11-2003','dd-mm-yyyy') and acch_cardno = acav_cardno and acav_readertype='I' order by acch_icno;
select distinct( acav_cardno ), acch_icno, acch_accesscode, acav_cardholdername from ac_cardholder,
ERROR at line 1:
ORA-00933: SQL command not properly ended
January 10th, 2004, 07:22 AM
Looks like you have two ; in your statement? Leave out the second one, or leave them out completely and try to terminate the query with / (in SQL*Plus)
January 10th, 2004, 09:24 PM
actually it cannot work. when i put first ";" and press enter, the oracle sql query seek waiting the input from me. so i put the second ";" and the error messages come out.
Here I have try the simply sql. and it can work.
but when i try(as follow, i added the "acav_readertype = 'I'"), the error message come out said "ERROR at line 2:
ORA-00936: missing expression"
hope that u can help me. Thanks!