From: Anthony Minessale Date: Thu, 25 Jun 2009 14:53:08 +0000 (+0000) Subject: more efficient sql stmt X-Git-Tag: v1.0.4~340 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7cba9a03beaa4e7ea17aa7049291e7d8b05a32c;p=thirdparty%2Ffreeswitch.git more efficient sql stmt git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13947 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 6b41831a88..ede6eb7073 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -2823,7 +2823,8 @@ SWITCH_STANDARD_API(show_function) } } } 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]; }