|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
select student_id, first_name, last_name
from users where student_id not in ( select u1.student_id from users u1, messages m1, groups g1 where u1.student_id = m1.student_id and g1.group_id = m1.group_id and g1.group_name = 'All Groups' ) Basically I want to select the users who haven't sent any messages (denoted by "squad"). I'm using JSP and the error I get is: ORA-00933: SQL command not properly ended Please help. Thanks in advance! Cheers Arti |
|
#2
|
|||
|
|||
|
I think the last line of your query is not ended properly, take a look :
g1.group_name = 'All Groups' in JSP how you can pass any value that is enclosed in single quote? As my understanding you have to write this query as follows: private String group_name; group_name = "All Groups"; SQL_STMT = "select student_id, first_name, last_name from users where student_id not in ( select u1.student_id from users u1, messages m1, groups g1 where u1.student_id = m1.student_id and g1.group_id = m1.group_id and g1.group_name = '" +group_name+"')"; If above query does not work then remove the last line of query and run it through your JSP, If it does work then you have to read the JSP specification document how to pass any value enclosed in single quote or how can you use any string value in SQL statement. |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Why won't this statement work? PLEASE HELP! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|