|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Issue in delete with subquery !
I've a table BaseMain with Columns NAME, PARENTKEY, etc.,.
PARENTKEY has value of parent row's NAME. say eg.: NAME | PARENTKEY a | NULL b | a c | b d | c While deleting the rows in BaseMain table with subQuery, to select the row matching PARENTKEY Value of the same table, all the matched rows are not deleted properly, instead deleted the rows of few levels (here a & b) and left the rest of rows as it is. No exception is thrown Query used : delete from BaseMain where NAME in (select NAME from BaseMain where PARENTKEY in (select NAME from BaseMain where PARENTKEY in (select NAME from BaseMain where PARENTKEY in (select NAME from BaseMain where PARENTKEY ='a'))) OR BaseMain.NAME in ( select NAME from BaseMain where PARENTKEY in (select NAME from BaseMain where PARENTKEY in (select NAME from BaseMain where PARENTKEY ='a'))) OR BaseMain.NAME in ( select NAME from BaseMain where PARENTKEY in (select NAME from BaseMain where PARENTKEY ='a')) OR BaseMain.NAME in ( select NAME from BaseMain where PARENTKEY ='a' ) OR NAME in (select NAME from BaseMain where NAME ='a')); firebird 1.0.3.972 (& also in Firebird 1.5). Any Limitation in using delete with subquery, selecting the same table data ?? How to resolve this ?? Thanks in advance. Regards, Pandya ! |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > Issue in delete with subquery ! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|