如何在多个表中删除Recrod [英] How to Delete Recrod in Multiple table
问题描述
hi
all
i开发了一个Job Portal网站。
i有2张桌子
User_Document
UserID ---------- DocID ----- CVTitle
1 -------------- 1 --------我的dotnet
1 ------------ --2 --------我的sharepointcv
1 -------------- 3 --------我的javacv >
和其他表是
UserJob
UserID ------------- DocID ------------- JobID ------------ AppliedDate
1 -------------- 1 ----------------- 3 --------------- 22 / 10/2013
1 -------------- 2 ----------------- 4 ---- ----------- 22/10/2013
1 -------------- 3 ---------- ------- 5 --------------- 22/10/2013
如何删除1条记录
告诉me plz
hi
all
i have develop a Job Portal Web site.
i have 2 tables
User_Document
UserID ----------DocID ----- CVTitle
1 --------------1 --------my dotnet
1 --------------2 --------my sharepointcv
1 --------------3 --------my javacv
and other table is
UserJob
UserID-------------DocID-------------JobID------------AppliedDate
1 --------------1-----------------3---------------22/10/2013
1 --------------2-----------------4---------------22/10/2013
1 --------------3-----------------5---------------22/10/2013
how to delete 1 record
tell me plz
推荐答案
如果你想从User_Document中删除表记录,除非你从UserJob表中删除它的主键,否则无法删除。
如果不是这样,则查询非常简单
从User_Document中删除UserID = 1
从UserJob中删除UserID = 1
if u want to delete from User_Document table record cannot be deleted until and unless you remove its primary key from UserJob table.
if that's not the case then the query is pretty much simple
delete from User_Document where UserID = 1
delete from UserJob where UserID = 1
这篇关于如何在多个表中删除Recrod的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!