The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Databases
> Oracle Development
|
sql query
Discuss sql query in the Oracle Development forum on Dev Shed. sql query Oracle Development forum discussing administration, Oracle queries, and other Oracle-related topics. Oracle is known as one of the most robust multi-platform relational databases available.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

January 9th, 2004, 09:19 PM
|
|
Contributing User
|
|
Join Date: Jul 2003
Posts: 76
Time spent in forums: 40 m
Reputation Power: 10
|
|
|
sql query
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?
Thank you!
Code:
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;
2 ;
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, 06:22 AM
|
|
Contributing User
|
|
Join Date: Oct 2003
Location: Germany
|
|
|
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, 08:24 PM
|
|
Contributing User
|
|
Join Date: Jul 2003
Posts: 76
Time spent in forums: 40 m
Reputation Power: 10
|
|
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.
Quote:
select acav_cardno, acav_cardholdername, acch_icno, acch_accesscode from ac_cardholder, ac_activity where acch_cardno = acav_cardno and trunc(acav_trxdatetime) between to_date('01-11-2003', 'dd-mm-yyyy') and to_date('30-11-2003', 'dd-mm-yyyy'); |
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"
Quote:
select acav_cardno, acav_cardholdername, acch_icno, acch_accesscode from ac_cardholder, ac_activity where acch_cardno = acav_cardno and acav_readertype = 'I' and trunc(acav_trxdatetime) between to_date('01-11-2003', 'dd-mm-yyyy') and to_date('30-11-2003', 'dd-mm-yyyy'); |
hope that u can help me. Thanks!
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|