Author: anthm Date: Thu Jun 25 09:53:08 2009 New Revision: 13947 Log: more efficient sql stmt Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c (original) +++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c Thu Jun 25 09:53:08 2009 @@ -2823,7 +2823,8 @@ } } } else if (!strcasecmp(command, "distinct_channels")) { - sprintf(sql, "select * from channels left join calls on channels.uuid=calls.caller_uuid where uuid in (select caller_uuid from calls) or (uuid not in (select caller_uuid from calls) and uuid not in (select callee_uuid from calls)) order by created_epoch"); + sprintf(sql, "select * from channels left join calls on " + "channels.uuid=calls.caller_uuid where channels.uuid not in (select callee_uuid from calls) order by created_epoch"); if (argv[2] && !strcasecmp(argv[1], "as")) { as = argv[2]; }