General Ledger Delete Unused Groups Query

From KeystoneIntranet
Revision as of 12:58, 14 July 2023 by WikiAdmin (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Preview with select query:

Select * from gltacgrp g
 where not exists
    ( select * from gltacct a where a.gl_group = g.group_id)
  and not exists
    ( select * from gltacgrp g2 where g2.parent_group_id = g.group_id)


DELETE from gltacgrp g
 where not exists
    ( select * from gltacct a where a.gl_group = g.group_id)
  and not exists
    ( select * from gltacgrp g2 where g2.parent_group_id = g.group_id)