query to delete all items in a department

i imported thousands of items using RR import utility that had wrong look up codes. i can tell becuase those items are never sold. i can re imort all those
items and put them in a same department or supplier called delete. how can i delete all the items in a department or supplier. i dont want to mess up my db. please help
Add pictures here
‚úĖ
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
hi Manos, before you do so backup your database
Then go to SO Admin | File Connect the Db | Then go to Query and click New: run the below query one by one
delete from supplierlist from department,item where item.departmentidřpartment.id and item.id=supplierlist.itemid and department.code='xx'
delete from alias from department,item where item.departmentidřpartment.id and item.id=alias.itemid and department.code='xx'
delete from item from department where item.departmentidřpartment.id and department.code='xx'
onces work rate me,or if need more help feel free to ask.
Akber
"manoj" wrote:

Add pictures here
‚úĖ
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Hello Akber, Thanks for the replay. just to make sure that this if if i want to delete all the items in a department called "delete". do i need to change anything in the query and do i really need to run all 3 querys? please let me know Thanks jay (manoj)
"Akber Alwani" wrote:

Add pictures here
‚úĖ
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
hi manoj
yes instead of department.code='xx' you can do department.code='delete' and for all 3 queries.
Akber Rate this. "manoj" wrote:

Add pictures here
‚úĖ
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Hello Akber, Thank you. it works Jay
"Akber Alwani" wrote:

Add pictures here
‚úĖ
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

BeanSmart.com is a site by and for consumers of financial services and advice. We are not affiliated with any of the banks, financial services or software manufacturers discussed here. All logos and trade names are the property of their respective owners.

Tax and financial advice you come across on this site is freely given by your peers and professionals on their own time and out of the kindness of their hearts. We can guarantee neither accuracy of such advice nor its applicability for your situation. Simply put, you are fully responsible for the results of using information from this site in real life situations.