Friday, April 20, 2012
DELETE based on 2 tables
How do I delete only records from temp1?
select a.*
from temp1 a,
patient b
WHERE a.chart_no = b.chart_no
and b.group_assignment = 'AAA'
DELETE FROM TEMP1
WHERE CHART_NO IN(
SELECT A.CHART_NO
FROM TEMP1 A,
PATIENT B
WHERE A.CHART_NO = B.CHART_NO
AND B.GROUP_ASSIGNMENT = 'AAA' )
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment