-1

Please Anyone there
if any conditions or query

i need to delete the details are matching accroding to Table adl_auth_user A

id      user_id     type_id     type_value  
66428     1919          1           97  

table user_details B

user_id     first_name      last_nam    
1919        Rins TE       Kola  

table adl_user C

id         email                   password 
1919    email@DOMAIN.COM         SOME PASSWORD

i want delete from these three

tables table1. user_id = table2.
> user_id and table1. user_id = table3.id

and group by

table1.type_id,table1.type_value

1 Answers1

0

try this . delete the records from table according to the table dependencies.

i think grouping is not required as you are trying to delete the records


DELETE FROM adl_auth_user 
from adl_auth_user  A 
INNER JOIN user_details  B ON a.user_id=B.user_id
INNER JOIN adl_user  C ON b.user_id=c.id
WHERE A.user_id =1919 AND A.type_id =1

DELETE FROM user_details  
FROM user_details B 
INNER JOIN adl_user C ON b.user_id=c.id
WHERE B.user_id =1919 

DELETE FROM adl_user  
WHERE adl_user .id =1919 
Sambhu
  • 23
  • 3