|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
a stored procedure question?
I have two tables.the structures like this
table one (total student table) id student_id 1 10 2 11 3 12 4 13 5 14 table two (graduated student table) id student_id 1 10 2 12 I want to get all of the student id who have not graduated. that is the records in table one but not in table two.the result like this. id student_id 2 11 4 13 5 14 I want to write a stored procedure to do it.please give me a idea how to write the stored procedure. Thanks a lot. |
|
#2
|
||||
|
||||
|
SELECT id, student_id
FROM table1 WHERE student_id NOT IN (SELECT student_id FROM table2) note: view would be better suited for this kind of query |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > a stored procedure question? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|