-
not in tab1 or not in tab2
My table 1 and tab2 both have primary key call student_id , if I want to do if the id is not in tab1 or not in tab2 then do insert ???
-
if exists(select tab1.student_id,tab2.student_id from tab1,tab2 where tab1.student_id=@student_id or tab2.student_id=@student_id )
begin
////code when a student_id exists
end
else
//// Insert query
begin
end
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|