1. Identify the records to delete
EXAMPLE
2. Run SQL statement to delete the desired classes
EXAMPLE:
3. Run SQL statement to delete orphaned SSS records
EXAMPLE:
4. Run SQL statement to delete orphaned SSM records
EXAMPLE:
Modified on: Sat, Aug 10, 2024 at 6:22 PM
EXAMPLE
SELECT SC, SE, SM, CN
FROM SMS
WHERE DEL = 0 AND SM = 'S'
EXAMPLE:
UPDATE SMS
SET DEL = 1
WHERE DEL = 0 AND SM = 'S'
EXAMPLE:
UPDATE SSS
SET DEL = 1
FROM (SELECT * FROM SMS WHERE DEL = 0) SMS
RIGHT JOIN (SELECT * FROM SSS WHERE DEL = 0 AND SE > 0) SSS ON SMS.SC = SSS.SC AND SMS.SE = SSS.SE
WHERE SMS.SE IS NULL
EXAMPLE:
UPDATE SSM
SET DEL = 1
FROM (SELECT * FROM SMS WHERE DEL = 0) SMS
RIGHT JOIN (SELECT * FROM SSM WHERE DEL = 0) SSM ON SMS.SC = SSM.SC AND SMS.SE = SSM.SE
WHERE SMS.SE IS NULL
Did you find it helpful? Yes No
Send feedback