10-22-2015 10:52 AM - edited 03-17-2019 04:40 AM
Hi,
Looking for some help with running an SQL command to count the number of trunks. This will return the count of most of the trunks:
run sql select count(tm.name) as Total from device as d inner join typemodel as tm on d.tkmodel = tm.enum where tm.name like '%Trunk%'
However I have a situation where I have multiple trunks with the same name but different Route Groups. This does not count the duplicates.
Basically looking for the cli equivalent of Device>Trunks
Thanks!
Solved! Go to Solution.
10-23-2015 06:08 AM
Hey
Count:
run sql select count(*) from routegroupdevicemap join device d on fkdevice = d.pkid join routegroup rg on fkroutegroup = rg.pkid
Check:
run sql select rg.name,d.name from routegroupdevicemap join device d on fkdevice = d.pkid join routegroup rg on fkroutegroup = rg.pkid
Regards
Aaron
10-23-2015 06:08 AM
Hey
Count:
run sql select count(*) from routegroupdevicemap join device d on fkdevice = d.pkid join routegroup rg on fkroutegroup = rg.pkid
Check:
run sql select rg.name,d.name from routegroupdevicemap join device d on fkdevice = d.pkid join routegroup rg on fkroutegroup = rg.pkid
Regards
Aaron
10-29-2015 09:54 PM
Aaron,
thanks for looking at this for me! so this is getting closer. now i seem to be missing trunks that dont have a route group assign (NULL). I have the same scenerio when trying to count CTI route points.
Thanks!
Jeremy
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide