Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

SQL query for fragments?

497542Mar 15 2006 — edited Mar 15 2006
I've got another problem. I have a table called student. I've got 3 lease tables called lease1, lease2 and lease3. all of them are like this Lease (leaseno, s_date, e_date, roomno, studno). The student table is(studno, sname, dob, address).i also have a number of room tables called room1 and room2 and room3. Room (roomno, floor). Each room has its own leases therefore room1's leases are called lease1 and so on.

How do I put a query that will check that a student has not made a lease in room2 or room3 if he comes to get a lease in room1. A student cannot make more than 1 lease.

When I type as below, it says invalid sql query and missing expression
select studno, sname from student where student.sno not in
(select studno from lease1) and (select studno from lease2) and (select studno from lease3) order by studno

please help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 12 2006
Added on Mar 15 2006
4 comments
388 views