Sunday, February 19, 2012

How to use "delete" query for more than two tables?

hi all,
i need to perform a operation where in to delete tableA,tableB based on some
conditions, here is the query,
***********************QUERY************
**************
delete from tblSS_ShiftPeriodStamps,tblSS_ShiftStamp
s where
tblSS_ShiftPeriodStamps.StartTime <= @.PurgeTime and
tblSS_ShiftPeriodStamps.EndTime <= @.PurgeTime and
tblSS_ShiftPeriodStamps.ShiftStartTime <= @.PurgeTime and
tblSS_ShiftStamps.ShiftEndTime <= @.PurgeTime and
tblSS_ShiftPeriodStamps.ObjectID = tblSS_ShiftStamps.ObjectID
***********************QUERY************
**************
how will i perform the above operation so that the checks are performed, for
the deletion of first table, i need to check in the second table also.
i would be happy if my friends could help me out...
thanks in advance,
regards,
ChakkaradeepOne object per Delete statement only.
Jens Suessmeyer.

No comments:

Post a Comment