vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi all.. I need to change the following Select statement to an update statement which updates hf.active to 'N' where all the hf.active found is 'n'.. I am finding difficulties of re-writting this because of the recursive relationship. select * from OrgUnit ou_sb inner join Allocation a on ( a.subjectOrgUnitId = ou_sb.orgUnitId ) inner join OrgUnit ou_tb on ( ou_tb.orgUnitId = a.parentOrgUnitId ) inner join HierarchyFlags hf on ( hf.orgUnitId = ou_sb.orgUnitId ) where ou_tb.orgUnitName = 'Old Books' and hf.active ='n' Many Thanks Ali |
| ||||
| What's your 'update' statement look like? Is the 'update' statement generating an error (if so, what error), or is it not functioning properly (ie, not updating the correct records)? ali.alauoubiy@drkw.com wrote: > Hi all.. > > I need to change the following Select statement to an update statement > which updates hf.active to 'N' where all the hf.active found is 'n'.. I > am finding difficulties of re-writting this because of the recursive > relationship. > > select > * > from > OrgUnit ou_sb inner join Allocation a > on ( a.subjectOrgUnitId = ou_sb.orgUnitId ) > inner join OrgUnit ou_tb > on ( ou_tb.orgUnitId = a.parentOrgUnitId ) > inner join HierarchyFlags hf > on ( hf.orgUnitId = ou_sb.orgUnitId ) > where > ou_tb.orgUnitName = 'Old Books' > and hf.active ='n' > > Many Thanks > Ali > |