...

View Full Version : delete datas from 2 tables in single query



urex
06-04-2011, 07:57 AM
table1

rno m1 m2

23 35 45


table2

rno s1 s2

23 98 78

iam using above tables .is it possible to delete rno=23 datas(rows) from both table1 and table2 in a single query.i tried DELETE FROM table1,table2 WHERE rno=23. but it not works.is their any way?

sunfighter
06-04-2011, 07:13 PM
Try this:


DELETE FROM table1, table2
USING table1
INNER JOIN table2 USING(rno)
WHERE table1.rno = 23


But PLEASE come back and tell me if it works.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum