This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
I am trying to get a subquery working, but somehow I am stuck. Can you please let me know what I have done wrong? This is what I want to achive but doesn't work. Can you please assist me. Thanks. UPDATE BS_REGISTRATION SET REGISTRATION_STATUS = 'enrolled' WHERE REGISTRATION_ID = (SELECT REGISTRATION_ID from BS_REGISTRATION where SESSION_ID= '21' and REGISTRATION_STATUS = 'waiting list' order by REGISTRATION_DATE asc limit 1 ) If I seperate them, it works properly. ie. UPDATE BS_REGISTRATION SET REGISTRATION_STATUS = 'enrolled' WHERE REGISTRATION_ID = 11 SELECT REGISTRATION_ID from BS_REGISTRATION where SESSION_ID= '21' and REGISTRATION_STATUS = 'waiting list' order by REGISTRATION_DATE asc limit 1 ---- The following works but not too good idea--- <% String select1 = "SELECT REGISTRATION_ID from BS_REGISTRATION where REGISTRATION_STATUS = 'waiting list' AND SESSION_ID = '"+ sid +"' order by REGISTRATION_DATE asc limit 1 ";
Are you sure your underlying database supports subqueries? Java passes the SQL to the underlying databases ODBC driver, so chances are if it is not working, then the database does not support subqueries. IIRC, MySQL and a few others do not currently support them.
Tom Blough<br /> <blockquote><font size="1" face="Verdana, Arial">quote:</font><hr>Cum catapultae proscriptae erunt tum soli proscripti catapultas habebunt.<hr></blockquote>